commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo PĂ©rez Ureta <edp...@gmail.com>
Subject [fileupload] Proposal to not use the platform default character encoding to prevent bugs.
Date Fri, 02 Jul 2010 20:45:15 GMT
I had a bug using fileupload because it uses the platform default
character encoding if a character encoding is not specified.

The platform default character encoding has nothing to do with the
character encoding the browser uses for the HTTP POST request, as the
character encoding used is the one specified in the charset on the
webpage.

As you may know nowadays the best way to develop an international web
application is to use UTF-8 everywhere.

So I suggest any of these three options:
- deprecate org.apache.commons.fileupload.util.Streams.asString(java.io.InputStream
pStream) that uses the platform default character encoding and
deprecate not calling
org.apache.commons.fileupload.FileUploadBase.setHeaderEncoding(String
encoding) by issuing a warning.
- use UTF-8 by default in both
org.apache.commons.fileupload.util.Streams.asString(java.io.InputStream
pStream) and org.apache.commons.fileupload.FileUploadBase.setHeaderEncoding(String
encoding) as it is common nowadays.
- use the default servlet container character encoding, as used in
javax.servlet.ServletRequest.getParameter(String name), in both
org.apache.commons.fileupload.util.Streams.asString(java.io.InputStream
pStream) and org.apache.commons.fileupload.FileUploadBase.setHeaderEncoding(String
encoding) as users expect.

Would you consider any of these changes?

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


Mime
View raw message