0
我有一個字符串,其中包含unicode 字。例如:使用unicode字轉換字符串
String uniString = "that is an example \u05e9\u05dc\u05d5\u05dd the end.";
所以我想問你的是,我怎麼能轉換這個字符串轉換成一個字符串,其中的Unicode字轉換成字符葛。
注:我從服務器請求獲取它。
謝謝你的頭。
我有一個字符串,其中包含unicode 字。例如:使用unicode字轉換字符串
String uniString = "that is an example \u05e9\u05dc\u05d5\u05dd the end.";
所以我想問你的是,我怎麼能轉換這個字符串轉換成一個字符串,其中的Unicode字轉換成字符葛。
注:我從服務器請求獲取它。
謝謝你的頭。
native2ascii
是你在找什麼:
http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/native2ascii.html
只是這樣做轉換的統一在源文件中逃脫:
native2ascii -reverse -encoding UTF-8 src/Foo.java transformed/Foo.java
他們_are_單個字符,它只是在字符是16位。你能舉一個你想要的結果的例子嗎? – 2012-02-18 22:50:48
您在那裏的語法只是Java編譯器預處理階段的Unicode字符的轉義語法。如果你願意,你可以直接輸入。結果將是相同的:在任何一種情況下,字符串都包含相應的字符。 – Joey 2012-02-18 22:58:25