Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一些字符串,例如Bình Định,Cà Mau(应该是“Bình Định”,“Cà Mau”)我应该怎么做才能将它们打印为“Bình Định”,“Cà mau”?
Bình Định
Cà Mau
我从一个 html 网站获得了这些字符串,我只想将它们写为“Bình Định”、“Cà Mau”到一个文本文件中。
这是你要找的吗?
int target = 236; char[] unicodeCharPair = Character.toChars(target); System.out.println("Char: " + new String(unicodeCharPair)); // Char: ì
使用getBytes()适合您的编码格式的方法
getBytes()