dcsimg
File Upload from IE5.0 using form-data with Japanese characters
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   CEN03_MS
Posted On:   Wednesday, January 15, 2003 02:21 AM

I am trying to upload file which has Japanese characters
This is how my jsp looks like



Now when the I try to read the file at the servlet end
the Japanese characters are garbled.

I also tried several workarounds such as adding UTF-8
encoding and trying to read the input stream with UTF-8
encoding, but was not successful.

If anyone has a solution or a sample code please respond.

Thanks
CEN03

Re: File Upload from IE5.0 using form-data with Japanese characters

Posted By:   sastry_dasigi  
Posted On:   Tuesday, March 18, 2003 10:22 AM

Read the content as a BufferedInputStream and write the same to a Byte[] using ByteArrayOutputStream

BufferedInputStream in = new BufferedInputStream(req.getInputStream());

ByteArrayOutputStream baos = new ByteArrayOutputStream(512);

The convert the Byte[] into a String. This should solve ur problem.

Goodluck.
About | Sitemap | Contact