2 Replies Latest reply on Sep 7, 2007 3:44 AM by junkie

    Encoding / GET vs. POST

    junkie

      I can successfully POST any Unicode character (especially non ISO-8859-1 chars) with my JSF-forms without having to deal with encodings.

      But I have one Seam component that takes parameters via @RequestParameter and GET.

      In this case I have to manually convert the input String like this:

      in = new String(in.getBytes("8859_1"), "UTF-8");

      If the input parameter was POSTed I don't need to do that.

      Why does Tomcat/JBoss/Seam convert the Unicode to ISO-8859-1 if the input was sent via GET?

        • 1. Re: Encoding / GET vs. POST
          christian.bauer

          Because URLs are not Unicode? (Yes, I know that there are extensions...)

          • 2. Re: Encoding / GET vs. POST
            junkie

            Thanks Christian - I believe that URLs are not ISO-8859-1 either... I have finally found this here in the forum:

            "If you are using Tomcat or JBoss all you have to do is [...] set URIEncoding to whatever character encoding you are using for the tomcat Connector in the server.xml.

            The default encoding is ISO-8859-1 for Tomcat if not set explicitly.

            <Connector port="8080" ... URIEncoding="UTF-8" .../>"

            I did that and now I can use my UTF-8 encoded URL parameters directly without conversion from ISO-8859-1 to Unicode.

            Can someone please recommend a book that deals with these kind of configurations?