Search code examples
objective-ciosutf-8nsxmlparsernsxml

I'm still having UTF-8 encoding issues with NSXMLParser


So I fixed my XML file and the PCDATA was indeed caused by the wrong encoding (ISO8859-1 wasn't right, see my previous question), but I still have incorrect chars using both ISO-8859-1 or UTF-8 encodings.

The problem is when I parse my file and get the chars :

- (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    NSLog(@"%@", foundCharacters);
    [self.currentNodeContent appendString:string];
}

If I have for example the "é" char, it will be transformed into "È".

What should I do ? Help ! Thanks for your answers


Solution

  • Finally I got it working by using TBXML.