我得到以下格式的字符串-
\"When you\u2019re riding, only the race in which you\u2019re riding is important.\u201D
其中 \u2019
表示单引号
和 \"
和 \u201D
用于左右双引号。
我想对其进行格式化,使其正确显示,例如-
"When you're riding, only the race in which you're riding is important."
我怎样才能做到这一点?
最佳答案
试试这个:
try
{
String s = new String("\"When you\u2019re riding, only the race in which you\u2019re riding is important.\u201D".getBytes(), "UTF-8");
}
catch (UnsupportedEncodingException e)
{
Log.e("utf8", "conversion", e);
}
关于java - 格式化 unicode 字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32346998/