geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick McGuire (JIRA)" <j...@apache.org>
Subject [jira] Commented: (GERONIMO-3638) should allow URL encoding with custom encoding charset other than the default
Date Thu, 13 Dec 2007 10:54:43 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-3638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551464
] 

Rick McGuire commented on GERONIMO-3638:
----------------------------------------

I'm not sure I understand the rationale for using US-ASCII as the default.  If I'm interpreting
the snippet for RFC 3986 correctly, UTF-8 should be the only encoding used for transforming
the textual data into a URL encoding.  This is essentially a 2-stage process.  1) encode the
characters in bytes using UTF-8 as the target encoding.  2)  Interpret those bytes as if they
were an 8-bit ASCII encoding and perform the URL encoding on that.  Since every character
in the US-ASCII character set would encode exactly the same way using UTF-8 as the converson
target, that encoding is contained within the new standard.   

I guess the only reason for allowing the charset to be specified would if the target of the
message is known not to support RFC 3986.  But in that case, it wouldn't make sense to try
to send those characters in the first place, since they wouldn't encode correctly.  So changing
the encoding at best provide a safety measure to ensure incorrect encoding are not sent. 

The provided patch does a very nice job of implementing the proposed behavior.  I'm not yet
convinced the proposed behavior is the correct one. 

> should allow URL encoding with custom encoding charset other than the default
> -----------------------------------------------------------------------------
>
>                 Key: GERONIMO-3638
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-3638
>             Project: Geronimo
>          Issue Type: New Feature
>      Security Level: public(Regular issues) 
>          Components: AsyncHttpClient
>    Affects Versions: 1.x
>            Reporter: Sangjin Lee
>         Attachments: 3638.patch
>
>
> Currently AsyncHttpClient uses Chartset.defaultCharset() when it encodes the query string.
 However, applications may want to use a different encoding than the machine default charset;
e.g. UTF-8.  It needs to provide a way to specify an encoding that AHC should use to encode
the query string.

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


Mime
View raw message