commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: FileUpload: File name in Japanese characters
Date Fri, 10 Jun 2005 06:26:34 GMT

Hi Jason,

The file system supports Japanese characters. I wrote a small java program 
which creating file with file name containing Japanese characters.
In my web application I printed the File name in log and it is showing in 
But when I am saving file on Disk using FileItem.write() method it is 
saving file with corrupted name.
Even I tried to save file using OutputStream but that also saved with 
corrupted name.

I guess the problem is with FileName.
As I said before that request.setCharacterEncoding("UTF-8") is done before 
handling request data.
I am creating File object passing the FileName and FileName may be in 
"utf-8" format. I am not sure whether File() support String in utf-8 
format. But normal String operation (concatenation etc) are working 
properly and printed properly in log files.

Even I tried following

                                                byte[] b = 
                                                String fileName1 = new 
"fileName1 = " + fileName1);

SJIS is character format supported by Japanese OS. But this showing 
corrupted string even in log file.

Any pointer to this problem?

Hitesh Chandmal Jodhavat

Jason Lea <> 
06/08/2005 01:15 PM
Please respond to
"Jakarta Commons Users List" <>

Jakarta Commons Users List <>

Re: FileUpload: File name in Japanese characters

Can the file system support japanese characters?

Can you rename a file and cut-and-paste some japanese characters in for 
the filename? wrote:

>request.setCharacterEncoding("UTF-8") is done before File save.
>I printed the file name in log and it is printed properly with Japanese 
>Actually I am appending some unique id to File Name and then saving on 
>I guess there is problem when I am appending the id to file name. 
>Is anybody aware of solution to this problem? 
>Hitesh Chandmal Jodhavat

Jason Lea

To unsubscribe, e-mail:
For additional commands, e-mail:


Notice: The information contained in this e-mail message and/or attachments to it may contain
confidential or privileged information.   If you are not the intended recipient, any dissemination,
use, review, distribution, printing or copying of the information contained in this e-mail
message and/or attachments to it are strictly prohibited.   If you have received this communication
in error, please notify us by reply e-mail or telephone and immediately and permanently delete
the message and any attachments.  Thank you
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message