I'm uploading a file to the server. The file upload HTML form has 2 fields:
- File name - A HTML text box where the user can give a name in any language.
- File upload - A HTMl 'file' where user can specify a file from disk to upload.
When the form is submitted, the file contents are received properly. However, when the file name (point 1 above) is read, it is garbled. ASCII characters are displayed properly. When the name is given in some other language (German, French etc.), there are problems.
In the servlet method, the request's character encoding is set to UTF-8. I even tried doing a filter as mentioned - http://stackoverflow.com/questions/29751/problems-while-submitting-a-utf-8-form-textarea-with-jquery-ajax - but it doesn't seem to work. Only the filename seems to be garbled.
The MySQL table where the file name goes supports UTF-8. I gave random non-English characters & they are stored/displayed properly.
Using Fiddler, I monitored the request & all the POST data is passed correctly. I'm trying to identify how/where the data could get garbled. Any help will be greatly appreciated.