You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/06/16 16:21:45 UTC

[jira] Resolved: (SLING-508) Parameter decoding uses wrong default charset

     [ https://issues.apache.org/jira/browse/SLING-508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-508.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.1

Committed the following fix to request parameter handling in Rev. 668173.

Before asking the servlet container for its request parameters, the ParameterSupport.getContainerParameters() method sets the request character encoding to ISO-8859-1 if not already set by the request itself. This should cause the request parameters to be decoded as ISO-8859-1.

After reading all request parameters all parameters (container parameters and multipart/form-data parameters) are re-coded to the encoding specified in the _charset_ parameter. For container parameters this means, they are converted to bytes again with ISO-8859-1 and then converted to strings using the _charset_ encoding.

Thus UTF-8 submitted data should be treated correctly, no matter what servlet container is actually used.

> Parameter decoding uses wrong default charset
> ---------------------------------------------
>
>                 Key: SLING-508
>                 URL: https://issues.apache.org/jira/browse/SLING-508
>             Project: Sling
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 2.0.0
>            Reporter: Tobias Bocanegra
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For: 2.0.1
>
>
> As of SLING-152 the request paremeters are re-encoded if a _charset_ parameter is present. it assumes that the default encoding is
> UTF-8 which is not the case for servlet spec compliant containers (eg. tomcat).
> change the default encoding to ISO-8851-1 or make it configurable.
> see: http://svn.apache.org/viewvc/incubator/sling/trunk/engine/src/main/java/org/apache/sling/engine/impl/parameters/Util.java?view=markup

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.