Is there any mapping table between windows code and java charset?

471 views Asked by At

Is there any mapping table between windows code and java charset?

Java Charset list

Windows Code page list

Why I want that: I have to read and analyse a binary file which contains part:

0x00 word codepage like 1252, 936, 65001 I knew, and also 50222 I did not know.
0x02 word string length
0x04 bytes null-terminated string 
...more strings...

I wrote the code:

int codepage = read16(inputStream);
int length = read16(inputStream);
byte[] bytes = new byte[length];
inputStream.read(bytes, 0, length);
String str = new String(bytes, getCharsetFromCodepage(codepage));

and getCharsetFromCodepage is what I want.

0

There are 0 answers