我已将具有外部字符的字符串 - 昼夜转换为字节数组。 字节数组可以存储-128到127之间的值,所以对应的值已经被存储为3个字节---> -26,-103,-99。字符串Bytearray
这里的转换代码:
String str = "晝";
byte[] b = str.getBytes();
for(byte bt : b)
System.out.println(bt);
String str1 = new String(b);
System.out.println(str1);
能否请你澄清这3个字节是如何被计算为外来字符
你是如何转换你的字符串的? [这](https://docs.oracle.com/javase/tutorial/i18n/text/string.html)将帮助 – SMA
{String str =“昼”; byte [] b = str.getBytes(); for(byte bt:b)System.out.println(bt); String str1 = new String(b); System.out.println(str1);} – Senthil
[UTF-8“可变宽度编码”如何工作?](http://stackoverflow.com/questions/1543613/how-does-utf-8-可变宽度编码工作) – Joe