3 Replies Latest reply on Apr 10, 2010 12:00 PM by ukyovirgden

    Encoding problem with UTF-8

      I'm having problem with encoding in my seam project.When I submit user data into database(data contains characters like ćčž) and check in the database,those characters are replaced with ? or similar.Database encoding is set to utf-8.I've also used filter class but the problem remains.After I manually replace the ? with appropriate character and check the user data on my web page it displays it correctly.Can someone help with this?

        • 1. Re: Encoding problem with UTF-8
          ukyovirgden

          I'm very new to Seam but I've been there a couple of times :)


          There are a couple things to check


          1. Make sure UTF-8 works with database. Using MySQL, I remember pulling my hair out many times at table and even column level wrong encoding. This is esspecially important if you change encoding after you create your database.


          2. Don't know which server you're using but with apache make sure you set UTF-8 with the listener. This is the setting that affects your form posted field encodings


          3. Again not with Seam but using facelets with Tomcat, I recall a setting a context param in web.xml


              <context-param>
                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                  <param-value>.xhtml</param-value>
              </context-param>
          



          Hope these help,


          Ukyo

          • 2. Re: Encoding problem with UTF-8
            ukyovirgden

            Oops. wrong paste.. meant to write...


                <context-param>
                    <param-name>com.sun.faces.disableUnicodeEscaping</param-name>
                    <param-value>true</param-value>
                </context-param>
            

            • 3. Re: Encoding problem with UTF-8
              ukyovirgden