[ http://issues.apache.org/struts/browse/STR-1838?page=all ]
     
David Evans reopened STR-1838:
------------------------------

    Assign To: David Evans  (was: Ted Husted)

> Struts tags use bytes of UTF-8 for urlencoding unconditionally
> --------------------------------------------------------------
>
>          Key: STR-1838
>          URL: http://issues.apache.org/struts/browse/STR-1838
>      Project: Struts Action 1
>         Type: Bug

>   Components: Taglibs
>     Versions: Nightly Build
>  Environment: Operating System: All
> Platform: All
>     Reporter: Yasuhiko Sakakibara
>     Assignee: David Evans
>      Fix For: 1.2 Family
>  Attachments: struts_urlencoding_charencoding.patch
>
> Struts urlencodes non-ascii characters using bytes of UTF-8 unconditionally.
> Although in the w3c's specification, UTF-8 is 'recommended' as
> character encoding method for non-ascii url string, this approach is not
> feasible in many case. Consider following scenario.
> I have a url that handle a search query. The pages of the site are
> character encoded in some encoding ,say, EUC-JP, so the POST request comes in 
> EUC-JP encoding. I want the url to handle both GET request and POST request, 
> so
> that I can embed a search string within href of some anchor elements. I
> think this is very common scenario.
> Now, when I use struts' html:forward tag, it is not possible because the
> GET request comes character-encoded in UTF-8, because the taglib uses
> UTF-8, and the POST request, from form submission, comes in EUC-JP
> because the page itself is encoded in EUC-JP. Same url, same request
> parameter, but different bytes... And when the request comes in, there
> is no reliable way to tell what character encoding system should be used
> to decode the incoming bytes.
> So I think it makes more sense for tags like html:forward, html:rewrite
> and html:image to have option to specify either to use local encoding 
> (obtained from HttpResponse#getCharacterEncoding) or to use UTF-8 as
> encoding method to get bytes.
> Right now, I am setting ServletRequest#setCharacterEncoding to UTF-8 if the 
> request method is 'GET', settting it to EUC-JP if the method is 'POST'. This 
> is 
> only possible because I am not using 'GET' for fom submission and can break 
> if 
> I need to change it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to