When I try the following in Java:
System.out.println(System.getProperty("file.encoding"));
I get cp1252as an encoding.
cp1252
Is there any way to find out where this value comes from? (Like environment variables or something else)
I would like to print the encoding value on the command line using some command such as systeminfo in Windows XP.
cp1252 - MS Windows ( Microsoft ANSI). Java . , . , . , ASCII, , InputStreamReader, OutputStreamWriter, String .. getBytes.
InputStreamReader
OutputStreamWriter
String
getBytes
, cp1252 Windows. cp437, ( ) chcp.
chcp
, , Windows, , , . , , API ANSI. ( , , , API, W).
Java- , Java Unicode . , .
, OEM-, DOS (850 437 - ).
Java, WSH script:
' save this script as printANSI.vbs ' usage: cscript /Nologo printANSI.vbs Set objShell = CreateObject("WScript.Shell") cp = objShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001" &_ "\Control\Nls\CodePage\ACP") WScript.Echo cp
. chcp; , Windows ( ).
, java, . eclipse Resource (Alt + Enter , Resource). cp1252 - , , UTF-8, woo... cp1252.
, JVM,