I am testing my application's i18n compatibility. I have a English version of Windows 7 which mean the system's display language is English. And I set the system locale as Chinese for non-unicode application.
My application encountered problems when exporting Html files with Chinese character under jdk1.6, but works fine when running under jdk1.7.
I debugged it and found the direct reason was that Charset.defaultCharset() returned different values.
Under jdk1.7 Charset.defaultCharset() returned GBK which is the charset for chinese.
Under jdk1.6 Charset.defaultCharset() returned window_1252 which is charset for Latin language.
I know the problem can be solved by designate charset,say utf-8, in code.
But I want to know why Charset.defaultCharset() return different values under JDK1.7 and JDK 1.6 .
System.getProperty("file.encoding")in both jdk 6 and 7?