tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kanpi" <ka...@ekuma.net>
Subject Re: How can set/get platform's default charset ?
Date Tue, 11 Sep 2001 02:58:30 GMT
 import  sun.io.*;
  public class EncodingCheck
  {
 public static void main(String args[])
 {

   System.out.println("System default encoding = "
     + System.getProperty("file.encoding"));

          System.out.println("ByteToCharConverter= "
            + ByteToCharConverter.getDefault());
          System.out.println("CharToByteConverter= "
            + CharToByteConverter.getDefault());

          int i = "XXXXX".length();
          System.out.println("System String.length = "
            + i);
  }
  }

System.setProperty() is defined also, but I have never used it.  When coding i18n
(internationalization, 18 chars between first i and last n), be careful about
javac -encoding <encoding> foo.java

As an example, when compiling the above, where XXXXX is your country's multi-byte
character, and the char is hard-coded, javac -encoding is required.

Welcome to the complicated i18n world.

akira kumakiri



Mime
View raw message