What is the right way to trim characters in foundCharacters
of NSXMLParser
?
I've found many examples that do it like this:
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
NSString *characters = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
// Append to previous characters of the same element
}
Yet a space followed by a non-ASCII character is trimmed when I run the above. Example: "this é" will become "thisé".