如何删除iPhone中的特殊字符?
我已经使用了Web服务并获得了XML格式的响应,之后我使用了xml解析来解析内容,但是我得到了 ä±: ürse kün 等,所以我想删除那些特殊字符,并且我使用了 NSUTF8StringEncoding 和NSASCII字符串编码。但它不起作用,所以请帮帮我?
I have used web service and get the response in the XML format, after that i have used xml parsing for parsed contents, but i get ı: ürse kün etc., SO i want to remove that special characters and i have used NSUTF8StringEncoding and NSASCIIStringEncoding. But it doesn't work, so please give help me out?.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您拥有的是二进制数据,或者拥有某种非 UTF-8 编码的字符串。假设是后者,您需要弄清楚该编码是什么,这完全取决于数据、它是什么以及它来自哪里。
Either what you have is binary data, or you have a string in some encoding that's not UTF-8. Assuming it's the latter, you need to figure out what that encoding is, which is entirely dependent on the data, what it is, and where it came from.
测试代码:100% 有效
输出:
或
输出:
TESTED CODE: 100 % WORKS
OUTPUT:
OR
OUTPUT: