问题
I'm programming an application using latin characters. Here are the lines I use to get data by XML parsing.
NSURL *url = [NSURL URLWithString:urlString]; // urlString : param of the function
NSData *data = [NSData dataWithContentsOfURL:url];
parser = [[NSXMLParser alloc] initWithData:data];
But for example, œ or ' are replaced by ¿. So what should I do ?
The encoding of my xml file :
<?xml version="1.0" encoding="ISO8859-1"?>
Thanks for your advices
回答1:
You can try this:
œ ==> œ and for ' ==> '
if you need more characters use this:
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
来源:https://stackoverflow.com/questions/10777859/nsxmlparser-encoding-error