Wrong re-encoding of request parameter values
---------------------------------------------
Key: SLING-1879
URL: https://issues.apache.org/jira/browse/SLING-1879
Project: Sling
Issue Type: Bug
Components: Engine
Affects Versions: Engine 2.1.0
Reporter: Davide Maestroni
Priority: Critical
When the request character encoding is different from the sling servlet
default, i.e. ISO-8859-1, the request parameter values are wrongly re-encoded.
In fact, in case the request encoding is UTF-8 and one of the parameter values
is "Orlèans", when ContainerRequestParameter.setEncoding() is called, the value
is first encoded into bytes using UTF-8 and then the same bytes are passed to
the new string with the ISO-8859-1 encoding. Thus what is effectively done is:
this.value = new String("Orlèans".getBytes("UTF-8"), "ISO-8859-1")
The resulting value is obviously wrong: "Orlèans".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.