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 Re: [fileupload] Proposal to not use the platform default character encoding to prevent bugs.
Date Mon, 05 Jul 2010 16:44:07 GMT
I still think the current default (the platform default character
encoding) is a bad default. And any of the proposed changes is way
better than the current default and will not cause any problems
anyone, just prevent or solve problems.

What about putting a comment in the javadoc of:
org.apache.commons.fileupload.util.Streams.asString(java.io.InputStream pStream)
and
org.apache.commons.fileupload.FileUploadBase.setHeaderEncoding(String encoding)
warning the user of the consequences of not setting a character encoding?


2010/7/4 Jochen Wiedmann <jochen.wiedmann@gmail.com>:
> 2010/7/2 Eduardo Pérez Ureta <edpeur@gmail.com>:
>
>> 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.
>
> I see no reason for deprecation. You are, of course, right that it is
> inappropriate for the case of an international application. But, it
> usually works perfectly for those applications, which aren't. And I
> believe that the latter are still the majority. UTF8 definitely is the
> better way in the long term, but it requires carefulness on all sides.
>
>
>> - 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.
>
> Definitely not. This would be an incompatible change. I might agree
> with you, that choosing the default for a new application would be
> subject to discussion, but not for an existing library, which is in so
> broad use like commons-fileupload.
>
>
>> - 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.
>
> Same idea, same reply: Incompatible change, thus forbidden.
>
>
> Sorry,
>
> Jochen

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


Mime
View raw message