我如何删除它们来自Web服务回乱码? [英] How do I remove unrecognized characters which come back from a web service?

查看:106
本文介绍了我如何删除它们来自Web服务回乱码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作它要求休息Web服务的应用程序。有时XML响应包含该手机无法显示的字符。当显示这些字符,则改为显示一个空框。我想筛选出这些字符。我怎么能检测一个字符就可以在屏幕上显示?

I am working on an app which calls a rest web service. Sometimes the xml responses contain characters which the phone can not display. When displaying these characters, an empty box is displayed instead. I would like to filter out these characters. How can I detect if a character will be able to be displayed on the screen?

一些具体字符包括:

http://www.fileformat.info/信息/ UNI code /炭/ 0094 / index.htm的
http://www.fileformat.info/info/uni code /炭/ 0080 / index.htm的
http://www.fileformat.info/info/uni code /炭/ 0092 / index.htm的

推荐答案

Android的支持下面的编码

Android support the following encodings


  • Xml.Encoding ISO_8859_1

  • Xml.Encoding US_ASCII

  • Xml.Encoding UTF_16

  • Xml.Encoding UTF_8

US_ASCII不应该使任何问题。

US_ASCII shouldn't make any problems.

有关ISO_8859_1前人的精力,你检查 http://en.wikipedia.org/wiki/ISO/IEC_8859-1
控制字符0x00-0x1f到0x7f,0x9f和过滤。
当然,使用匹配的字体。

For ISO_8859_1 you sould check http://en.wikipedia.org/wiki/ISO/IEC_8859-1 for control chars 0x00-0x1f and 0x7f-0x9f and filter them. And of course use a matching font.

使用UTF_8或16个比较复杂,读Joels 绝对最低每一个软件开发人员绝对,积极必须知道关于统一code和字符集

Using UTF_8 or 16 is more complex, read Joels The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets

您可能会发现这个邮件列表有用的。

You might find this mailing list useful.

这篇关于我如何删除它们来自Web服务回乱码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆