[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: Equinox and UTF-8

Hi Holger,

Please have a look at the command line that Eclipse generates. I noticed that Eclipse automatically passes -Dfile.encoding parameter depending on the encoding set on the Java source file, project properties or system default.

BTW, I also can't confirm your observations. There are no differences on my Windows system (Version 6.0.6001).

Eclipse, Test.java, uses default encoding (Cp1252)
D:\Java\jdk1.6.0_05\bin\javaw.exe -Dfile.encoding=Cp1252 -classpath T:\workspaces\encoding-test\test\bin Test
 length() = 1
 cast to byte = -89
 getBytes() = -89

Eclipse, Test2.java, uses UTF-8 encoding
D:\Java\jdk1.6.0_05\bin\javaw.exe -Dfile.encoding=UTF-8 -classpath T:\workspaces\encoding-test\test\bin Test2
 length() = 1
 cast to byte = -89
 getBytes() = -62 -89

Command Line, Test.java, uses default encoding (Cp1252)
D:\>D:\Java\jdk1.6.0_05\bin\java.exe -Dfile.encoding=Cp1252 -classpath T:\workspaces\encoding-test\test\bin Test
 length() = 1
 cast to byte = -89
 getBytes() = -89
 getBytes("UTF-8") = -62 -89

Command Line, Test2.java, uses UTF-8 encoding
D:\>D:\Java\jdk1.6.0_05\bin\java.exe -Dfile.encoding=UTF-8 -classpath T:\workspaces\encoding-test\test\bin Test2
-Â length() = 1
-Â cast to byte = -89
-Â getBytes() = -62 -89
-Â getBytes("UTF-8") = -62 -89


Gunnar Wagenknecht