[英]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.