[英]Print the unicode code instead of character
我希望eclipse允许打印并保存unicode代码而不是字符(供以后的其他程序使用)。
String string = "\u2588";
我希望输出为\\ u2588而不是块字符。
第一次发布,所以对任何做错的事情感到抱歉:(。
String string = "\\u2588";
如果使用两个反斜杠,则不会尝试检测转义序列 。
反斜杠\\
是转义字符 ,要打印实际的'\\'
使用"\\\\"
String s = "\\u2588"
使用此代码打印Unicode字符
String unicodeMessage =
"\u7686\u3055\u3093\u3001\u3053\u3093\u306b\u3061\u306f";
PrintStream out = new PrintStream(System.out, true, "UTF-8");
out.println(unicodeMessage);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.