Coding cp1252

When I try the following in Java:

System.out.println(System.getProperty("file.encoding"));

I get cp1252as an encoding.

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.

+5
source share
5 answers

cp1252 - MS Windows ( Microsoft ANSI). Java . , . , . , ASCII, , InputStreamReader, OutputStreamWriter, String .. getBytes.

, cp1252 Windows. cp437, ( ) chcp.

+5

, , Windows, , , . , , API ANSI. ( , , , API, W).

Java- , Java Unicode . , .

, OEM-, DOS (850 437 - ).

+3

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 ( ).

+1

, java, . eclipse Resource (Alt + Enter , Resource). cp1252 - , , UTF-8, woo... cp1252.

0

, JVM,

-1

All Articles