在我的 Android 应用程序中,我使用 utf-8 字符集从服务器获取 JSON 数据。我使用以下代码对来自服务器的数据进行编码:
try {
HttpResponse execute = client.execute(httpGet);
InputStream content = execute.getEntity().getContent();
BufferedReader buffer = new BufferedReader(
new InputStreamReader(content, "utf-8"));
String s = "";
while ((s = buffer.readLine()) != null) {
response += s;
}
return response;
在我的应用程序中,我可以看到所有特殊字符,如ä、ü等,但不显示“(引号)。在Android 5.0以下,有空格,在Android 5.0中,是一个框而不是性格(如您在照片中看到的)。 如何用 Unicode“\u0084”和“\u0093”显示引号?
这是 Android 5.0 (Api 21) 的屏幕截图
这是 Android 4.3 中的一个:
最佳答案
那些\u0093
和\u0084
实际上是控制字符。他们不一定有实际的代表。
您应该使用 \u201C
和 \u201D
参见: http://www.fileformat.info/info/unicode/char/201C/index.htm和 http://www.fileformat.info/info/unicode/category/Pi/list.htm
关于java - Android UTF-8编码引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29809101/