我有Windows-1251代码表中的字符代码。如何获取该字符在UTF-8码表中的编码?
例如,在Windows1251中编码的字符'А‘等于192,适当的utf-8代码等于1040
如何用Windows-1251代码表中的192号初始化Java中的字符或字符?
char c= (char)192;//如何指定编码?
发布于 2011-12-23 17:02:11
要将一种字符编码中的byte[]编码转换为另一种字符编码,可以执行以下操作
public static byte[] convertEncoding(byte[] bytes, String from, String to) {
return new String(bytes, from).getBytes(to);
}
https://stackoverflow.com/questions/8613957
复制相似问题