4 Replies Latest reply on Jan 12, 2010 4:22 PM by sait

    UTF-8 Encoding For JBoss 5.1 AS

    sait

      Hi,
      I have an encoding problem with JBoss AS 5.1 . There are encoding problems at my html's. The steps that I have done.


      1- Added <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> between <head> tags in html files.


      2- Changed


      <Connector port="8080" address="${jboss.bind.address}"   
           maxThreads="250" maxHttpHeaderSize="8192"
           emptySessionPath="true" protocol="HTTP/1.1"
           enableLookups="false" redirectPort="8443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8" useBodyEncodingForURI="true" />


      in jboss/server/default/deploy/jbossweb.sar/server.xml


      3- Added


      <web:character-encoding-filter encoding="UTF-8"
                override-client="true" url-pattern="*.seam" />

      in components.xml


      4- Added -Dfile.encoding = utf-8 in JBoss AS start JVM arguments.


      5- Set html file encodings as UTF8


      With FireFox, when I look Page Info, it points out its encoding is ISO-8859-1 and meta is text/html; charset=UTF-8 .


      How can I can ISO-8859-1 encoding type to UTF-8 ?


        • 1. Re: UTF-8 Encoding For JBoss 5.1 AS
          salski22

          Hi


          I had similar problem, what I did? I saved html page in UTF encoding using some text editor like notepad.


          regards


          Jacek

          • 2. Re: UTF-8 Encoding For JBoss 5.1 AS
            sait

            Hi Piotr,
            The solution is not easy as you mentioned. All files are encoded as UTF-8 and I have added -Dfile.encoding=utf-8 in JBoss AS start JVM arguments. But I can not change JBoss default encoding type ISO-8859-1. The problem occurs  only for static content files like html in seam project.

            • 3. Re: UTF-8 Encoding For JBoss 5.1 AS
              salski22

              Check this post
              http://seamframework.org/Community/UTF8EncodingProblem


              I tried similar steps as you did. Finaly I didn't change enything what was setup by default only I saved files in UTF-8 and I set up project properties\text file encoding to UTF-8

              • 4. Re: UTF-8 Encoding For JBoss 5.1 AS
                sait

                Thanx Piotr,


                However I set the workspace text encoding as UTF-8 before, after your post I checked again and saw that UTF-8 is set.
                I have no problems with dynamic pages like xhtmls. There are no encoding problems. The problem occurs only for static content files like htmls in seam project.


                I copied these htmls into the jboss/server/default/deploy/ROOT.war and saw that there was no problem. HTMLs can be hosted under root without encoding problems.




                Regression testing? What's that? If it compiles, it is good, if it boots up it is perfect.  Linus Torvalds