1. #1
    Sencha User
    Join Date
    Dec 2011
    Location
    Braunschweig, Germany
    Posts
    18
    Vote Rating
    0
    Answers
    1
    gilaras is on a distinguished road

      0  

    Question Answered: Encoding problems...

    Answered: Encoding problems...


    Hi everyone,

    here I am again, with a totally different problem today

    I'll start with a screenshot of my problem ...

    screen.jpg

    As you can see, I have two simple dropdowns and a textfield to search for employees. In this case I try to search for an employee with last name "Müller" ... or something else with ä, ö, ü, ... special characters.

    It seems to me that everything works fine, but when building the URL, it generates M%C3%BC...
    That's kind of awkward, because I just can't get it to search for "Müller" ...
    I guess there is an encoding problem, but I cannot spot it ...

    In my JSP, I have <%@ page pageEncoding="UTF-8" %> and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>, it is saved as UTF-8 and so on. In the HTTP-Header, it says "Content-Typeapplication/json;charset=UTF-8" too ...

    I don't know what to do now ... can someone help me with that one?

    Thanks in advance and greets
    gilaras
    Attached Images

  2. I don't think this is an ExtJS question but I'll attempt to answer it anyway.

    You can't just send 'Müller' in a URL, it's invalid. It has to be be URL encoded.

    The encoding you're seeing appears to be UTF-8. This is what JavaScript does by default if you call encodeURIComponent('Müller').

    For a POST request there is a convention that all parameters should be URL-encoded as UTF-8. Unfortunately no such convention exists for GET requests and by default many servers (including Tomcat) will use ISO-8859-1.

    You may find this helpful:

    http://stackoverflow.com/questions/1...ameter-in-java

    When I'm working with a Java server I tend to force all my requests to POST requests, largely to avoid this problem. It isn't so bad if you have full control over the server but when you're just deploying a WAR file it's a real nuisance to ask people to edit their Tomcat config.

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,625
    Vote Rating
    331
    Answers
    550
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I don't think this is an ExtJS question but I'll attempt to answer it anyway.

    You can't just send 'Müller' in a URL, it's invalid. It has to be be URL encoded.

    The encoding you're seeing appears to be UTF-8. This is what JavaScript does by default if you call encodeURIComponent('Müller').

    For a POST request there is a convention that all parameters should be URL-encoded as UTF-8. Unfortunately no such convention exists for GET requests and by default many servers (including Tomcat) will use ISO-8859-1.

    You may find this helpful:

    http://stackoverflow.com/questions/1...ameter-in-java

    When I'm working with a Java server I tend to force all my requests to POST requests, largely to avoid this problem. It isn't so bad if you have full control over the server but when you're just deploying a WAR file it's a real nuisance to ask people to edit their Tomcat config.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Location
    Braunschweig, Germany
    Posts
    18
    Vote Rating
    0
    Answers
    1
    gilaras is on a distinguished road

      0  

    Default Thanks

    Thanks


    Hi,

    thank you very much.
    I changed it to do an Ajax POST request, not it works just fine

Thread Participants: 1

Tags for this Thread