我收到以下格式的字符串 -
\"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."
我该怎么做?
答案 0 :(得分:2)
试试这个:
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);
}