3 Replies Latest reply on Apr 12, 2012 1:18 PM by jobame

    default file.encoding

    sue12

      Hello,

      I am looking for help about changing the default file.encoding on Jboss.

      I installed Jboss-3.2.3(apache Tomcat 5.0.16) on linux 2.4.9-e.37.
      in boot.log, it shows that the file.encoding is ISO-8859-1. I would like to change it to UTF-8.

      I tried:

      in .bashrc, set the following:

      JAVA_OPTS=-Dfile.encoding=UTF-8
      ANT_OPTS=-Dfile.encoding=UTF-8
      LC_CTYPE=en_US.UTF-8

      in run.sh and run.conf set the following:

      JAVA_OPTS=-Dfile.encoding=UTF-8

      restart jboss.

      The result I got:
      Form file Test.java

      import java.util.*
      import java.io.*

      public class Test {
      public static void main(){
      System.out.println(getProperty("file.encoding"));
      System.out.println(ImputStreamReader(System.in).getEncoding());
      }
      }

      on command line:
      >javac Test.java
      >java Test
      >UTF-8
      >UTF8


      in boot.log:
      file.encoding: ISO-8859-1

      It doesn't seem that jboss takes the modification of the value of the file.encoding and overwrites the value of file.encoding from JVM.

      Is there any place where one can set the default file.encoding?

      Thanks,

      Sue



        • 1. Re: default file.encoding
          rziegler721

          On Linux? Try setting these variables before starting.

          export LANG=en_US.UTF-8
          export LANGVAR=en_US.UTF-8

          I've heard the -Dfile.encoding parameters are not always reliable.

          ~Rick

          • 2. Re: default file.encoding
            sue12

            Rick, Thanks for replying. Just tried your suggestion. Still, in boot.log it shows file.encoding is ISO-8859-1.

            -Sue

            • 3. Re: default file.encoding
              jobame

              My post is a bit late However, you posting helped me to solve the german "Umlaut" problem (e.g. ä, ö,...) by adding the variables in my user profile. My boot.log shows the file.encoding was changed and those letters are saved correctly in my mysql database.