where does java get the default encoding from?
I tried the following code on two records: redhat 4 and centos 5
public class EncodingTest { public static void main(String args[]) throws Exception{ System.out.println(System.getProperty("file.encoding")); System.out.println( new java.io.OutputStreamWriter( new java.io.ByteArrayOutputStream()).getEncoding() ); } }
I have two different results: redhat UTF-8 and for centos ASCII. This is the same installation and version of java (1.4). I run java without the -Dfile.encoding parameter.
Thanks.
source share