Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java中的Unicode补充多语言平面_Java_Unicode_Astral Plane - Fatal编程技术网

Java中的Unicode补充多语言平面

Java中的Unicode补充多语言平面,java,unicode,astral-plane,Java,Unicode,Astral Plane,我想在Java中使用SMP(补充多语言平面)。实际上,我想打印一个代码点大于0xFFFF的字符。我使用了这行代码: int hexCodePoint = Character.toCodePoint('\uD801', '\uDC02' ); 具有特殊字符的代码点。但是如何将此unicode字符打印到控制台 提前感谢您的帮助 String s = new StringBuilder().append("Here is a codepoint: ").appendCodePoint(hexCode

我想在Java中使用SMP(补充多语言平面)。实际上,我想打印一个代码点大于0xFFFF的字符。我使用了这行代码:

int hexCodePoint = Character.toCodePoint('\uD801', '\uDC02' );
具有特殊字符的代码点。但是如何将此unicode字符打印到控制台

提前感谢您的帮助

String s = new StringBuilder().append("Here is a codepoint: ").appendCodePoint(hexCodePoint).toString();
System.out.println(s);
注意,在Windows中,由于控制台的Unicode功能有限,它不会产生预期的输出

编辑:或
Character.toChars(hexCodePoint)
生成
char[]

System.out.println("\uD801\uDC02");
现在,U+10402(