Hi Jeffery,

On 11.12.17 18:55, Jeffery Painter wrote:
> It sounds like you recommending then that we get rid of
> input.encoding=<user defined> completely from the TR.props config. Is
> that correct? It has been in there since 2.3.x days

I'd rather get rid of "locale.default.charset" and friends and replace
them with input.encoding or introduce a default.encoding setting to rule
them all.

> I searched through the code base and the method call to
> Turbine.getDeafultInputEncoding() is never referenced anywhere currently
> except in one test case.  The DefaultTurbineRunData.getDefaultCharSet()
> currently pulls from Turbine configuration constants, and without the
> current patch, this value never gets updated by the user defined property.

Normally, the input encoding should be read from the servlet request. I
don't see any real reason to respond with a charset different from what
is requested.

> It would make more sense to me that it should be handled as you mention
> below, but I am not sure where to start to make all the fixes required.
> Similar issues exist around updating the default locale.
> 
> If we were to get rid of it completely, do you agree UTF-8 should be the
> new default or are there reasons it should be something else? How do we
> handle modifying the default locale to also conform?

IIRC, the default encoding of HTTP requests according to RFC2616 is
ISO-8859-1. So if we agree with the RFC, we must not change the default.

> I could not move to Turbine 4.0 without UTF-8 support, and this fix
> allows for it.  Seems a bit clunky to have to set it manually the way I
> have done though.  Open to your thoughts/suggestions on a better way
> forward :-)

I strongly believe that the encoding setting is the responsibility of
the servlet container, not the application, let alone the framework. All
settings in the Turbine configuration are only defaults for the case
when the container does not provide an encoding (and always have been).

The two settings you tried to pull straight are probably redundant. I
remember having trouble when I set them to different values (I need to
double check, though). So my suggestion is to cut it down to just one
default encoding for good.

For methods to set the container encoding, see for example
https://wiki.apache.org/tomcat/FAQ/CharacterEncoding

Does that make sense to you?

Bye, Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to