« Return to Thread: Reading unicode characters from a form in multipart/form-data format

Re: Reading unicode characters from a form in multipart/form-data format

by Song Jason :: Rate this Message:

Reply to Author | View in Thread

Hi Ylva,
 
This should be a commons-upload problem, also known as uploading file name doesnot support utf-8 and can be just treat as ascii.
attached my version for commons-upload.jar, have a try. I believe I solved it.
 
Good luck.
Jason Song
On Tue, Apr 29, 2008 at 4:22 PM, Ylva Degerfeldt <ylva.degerfeldt@...> wrote:
Hi everyone!

I joined this list in hope of that someone can help me with this problem:

Is there a way to use UTF-8 when reading from form fields with
multipart/form-data format? (I'm using Apache commons
ServletFileUpload so that's why I'm asking on this mailing list.)

I've searched the web for answers and though this seems to be a well
known problem, I haven't found any solution to it.

I have to have a multipart/form-data form because I want the users to
be able to save their names and birthdate on the same jsp page as
where they can upload a (cv) file, so I have to find a solution.

My jsp page has the meta tag attribute charset="UTF-8", the form has
the attribute accept-charset="UTF-8" and in the servlet which receives
this request I do a:

request.setCharacterEncoding("UTF-8");

but none of those things seem to help.

I also tried using the setHeaderEncoding method of the
ServletFileUpload class but that didn't help either. I still receive
Swedish characters as "weird looking characters" and that's not what I
want.

If anyone has a solution to this problem I would be Very grateful!
(Even if the solution means that I have to convert the strings I
receive in some way.)

Thanks in advance,

Ylva

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

commons-uploads.jar (54K) Download Attachment

 « Return to Thread: Reading unicode characters from a form in multipart/form-data format

LightInTheBox - Buy quality products at wholesale price