嗨,我想将unicode值“\ u20BA”转换为土耳其等效字符串。有人可以帮我吗?如何在java中将unicode字符串转换为土耳其语?
我用下面的代码:
try {
String string = "\u20BA";
System.out.println(string + " " + string.toLowerCase());
// Locale.setDefault(new Locale("tr"));
// Locale tr = new Locale("TR","tr");
byte[] converttoBytes = string.toLowerCase().getBytes("UTF-8");
string = new String(converttoBytes, "Cp1254");
System.out.println(string + " " + string.toLowerCase());
} catch (Exception e) {
e.printStackTrace();
}
你是什么意思转换的字符意味着(显然是U + 20BA TURKISH LIRA SIGN,引入Unicode 6.2)“土耳其语”还是“土耳其语字符串”?对于土耳其语中的一个词?该代码显示没有这种尝试。你的意思是转换为CP 1254字符编码吗?首先,它不包含U + 20BA。 –