commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campbell, Lance" <la...@illinois.edu>
Subject [fileupload] UTF-8 encoding issue
Date Mon, 01 Aug 2016 17:50:54 GMT
Commons File Upload 1.3.2

I am using the commons file upload version 1.3.2 via servlets for apache-tomcat 8.  All of
my servlets work with UTF-8 except for when I am using the commons file upload library. 
It seems to be setting the encoding to "ISO-8859-1" .  I have set both the request and response
headers to UTF-8.  I have also set the Java VM to use UTF-8.

How can I get around this issue?

I have read online to do the following:
req.setCharacterEncoding("UTF-8");
resp.setContentType("UTF-8");
resp.setCharacterEncoding("UTF-8");

I have also read to set this at the form:

accept-charset="UTF-8"

It seems like your code is hardcoding the encoding to "ISO-8859-1" in the class FileUploadBase.

Why not allow us to set the encoding in a method then use the "ISO-8859-1" as a fall back?

Thanks,

Lance Campbell


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


Mime
View raw message