Shift

xiaoxiao2021-03-06  54

Test environment: Win2k Pro Japanese version, Sun J2SDK 1.5.0-beta2

After testing, the encoding of the full-angle line ("~") encoded ("~") encoded is found to be 0x8160 (16). After the convertE character '/ uff5e' is converted by Sun.io.byTocharms932, you get Unicode characters '/ u301c' after converting through Sun.io.byTocharsjis.

Conversely, Unicode characters '/ uff5e' is converted by Sun.io.Chartobytems932, will receive the MS932 encoded local character 0x8160 (16), two bytes, high in front), and Unicode characters '/ u301c' passes Sun.IO .CHARTOBYTESJIS will also get the local character 0x8160 (16), two bytes, high positions), the same conversion results in both.

Conclusion: On WinNT / 2K / XP, the two local character sets of MS932 and Shift_JIS are identical, but the JDK's Sun. I.ByTocharms932 and Sun.io.byTocharsjis are converted to individual special local characters. Unicode characters are not the same. In fact, MS932 is Shift_JIS on WinNT / 2K / XP, just compared to the standard version of Shift_JIS character set, MS932 includes more characters, such as NEC and IBM's extension of Shift_JIS (such as "in Japanese" ㊧㊨ [1.. ⑳ ... "", "However, bytetocharsjis and Chartobytesjis in JDK use standard Shift_Jis character set, so some extended characters will be converted from byte into char or from char to BYTE There is garbled, which is indeed a JDK that is very confused. Reference 1 (Japanese): http://www.asahi-net.or.jp/~ez3k-msym/charsets/jis2ucs.htm

转载请注明原文地址:https://www.9cbs.com/read-117176.html

New Post(0)