iPhone - prevent Invalid Hex character error with NSXMLParser
I am parsing an XML coming from a web server and the parsing sometimes stops with Error code 6. From the documentation, I found out the error is NSXMLParserInvalidHexCharacterRefError.
The character in question开发者_JS百科 is Ĵ. Can someone please tell me how I can prevent NSXMLParser from sending an error if it encounters these characters (or rather, doesn't NSXMLParser support unicode encoding?)
Thanks.
I ran across a similar issue a little while back, I can't seem to find the documentation right now, but I believe that NSXMLParser will evaluate found characters using whatever encoding is specified by the XML document, if the document has characters that are not supported by that encoding the error will occur.
Could you post a sample XML document so we might see what encoding(if any is specified). Also, could you let us know which element the error occurs on?
精彩评论