JAVA?е???????????
???????????? ???????[ 2013/12/24 16:42:05 ] ????????JAVA ???????
??????ε????????????
????System.out.println(System.getProperty("file.encoding"));
????str??unicode???????????????????????
printBytes(str.getBytes("utf-8")); // -28 -72 -83 -26 -106 -121
printBytes(str.getBytes("unicode")); // -2 -1 78 45 101 -121
printBytes(str.getBytes("gb2312")); // -42 -48 -50 -60
|
???????????iso8859-1?????iso8859-1???????????????63??63
????printBytes(str.getBytes("iso8859-1")); // 63 63
???????bytes??????????????????string
byte[] bytes = {-28?? -72?? -83?? -26?? -106?? -121};
System.out.println(getStringFromBytes(bytes??"utf-8"));
byte[] bytes1 = { -2??-1??78?? 45?? 101?? -121};
System.out.println(getStringFromBytes(bytes1??"unicode"));
System.out.println(new String(bytes1));//
|
????bytes1??unicode??"????"??????????????utf-8????unicode??bytes????utf8????????????string??????
????????????????????????
?????????????utf8???????????????“????”?????????hex???????????????????
????readBytesFromFile("C:/D/charset/utf8.txt");????????????bytes??-17 -69 -65 -28 -72 -83 -26 -106 -121??????-28 -72 -83 -26 -106 -12??"????"??utf-8????bytes??-17 -69 -65 ??utf8????????????????????????bytes??e4=256-28=228??getBytes???????-28????e4???????????????
?????????????gb2312???????????????“????”?????????hex???????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11