?Java?,????char
???Character.UnicodeBlock
???????Unicode????????
???????Unicode??,????char
???Character
??toChars()
??????????:
String chineseCharacter = "?"; char[] unicodeChars = chineseCharacter.toCharArray(); for (char c : unicodeChars) { String unicode = String.format("\\ux", (int) c); System.out.print(unicode); }
??????
?
??Unicode???????,????Character
??toChars()
??????????:
String unicode = "\?"; int codePoint = Integer.parseInt(unicode.substring(2), 16); char[] chars = Character.toChars(codePoint); String chineseCharacter = new String(chars); System.out.println(chineseCharacter);
??????
?
???,???????????????????????????,???????????