windows code和java charset之间是否有映射表?
为什么我想要那个: 我必须阅读并分析包含部分的二进制文件:
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...
我写了代码:
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));
和getCharsetFromCodepage是我想要的。