【发布时间】:2011-08-27 04:05:43
【问题描述】:
我在解析包含一些特殊字符(如单引号、双引号('、"")等的 xml 文件时遇到问题。我正在使用NSXMLParser 的parser:foundCharacters:方法在我的代码中收集字符。
<synctext type = "word" >They raced to the park Arthur pointed to a sign "Whats that say" he asked Zoo said DW Easy as pie</synctext>
当我从我的 xml 文件的上面标记中解析并保存文本时,生成的字符串出现在 GDB 中,为
“\n\t\t他们跑向公园,亚瑟指着一个标志“那是什么意思”,他问动物园说 DW Easy as pie”;
观察有2个问题:
1) 字符串开头不需要的字符。
2) Whats that say 周围的双引号。
谁能帮助我如何摆脱这些不需要的字符以及如何正确读取特殊字符。
【问题讨论】:
标签: iphone special-characters nsxmlparser xml-parsing