Results 1 to 2 of 2

Thread: Non-ASII characters in URL

  1. #1
    Join Date
    Dec 2004
    Posts
    19

    Question Non-ASCII characters in URL

    Hi,

    I configured my CharacterEncodingFilter correctly. Input Chinese characters through form posting is working fine. I am able to store and display Chinese characters successfully.

    To make my pagination working, I need to support Chinese characters in URL. I am using jstl construct the url:
    search.do?query=${query}

    when I hit the url, I can see the chinese characters are shown in browser status bar successfully, however, wrong characters are picked up on the server side, so no result shown.

    Does anyone has experience to make Non-ASCII in URL working?

    thanks,
    laker
    Last edited by lakershen; Sep 2nd, 2007 at 10:41 PM. Reason: typo

  2. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Quote Originally Posted by lakershen View Post
    search.do?query=${query}

    Does anyone has experience to make Non-ASCII in URL working?
    I'm not that fit anymore with handling encoding issues correctly, but I remember the above is likely to break for the following reason (please correct me if I write nonsense ): First there is a page encoding. Usually browser use the page encoding for sending the next request, but they don't set the corresponding request header. An application should therefore read requests the same way the send the response.

    So far so good ... now your link. That one is NOT page-encoded, but Url-encoded which means UTF-8 (is this really correct?). Now if the page-encoding is different and the application tries to parse the UTF-8-encoded request with the page encoding it will fail. I remember I had exactly this case ... 5 to 6 years back We switched to form a form and hidden parameters and the links where changed to buttons. A form is submitted in page encoding.

    Joerg
    This post can contain insufficient information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •