I’m grabbing a JSON feed but weird characters shows up in the JSON feed. For example pass\u00e9 represents passé. i already utf-8 it with NSUTF8StringEncoding
i’m using the next JSON:
NSString *jsonString = [NSString
stringWithContentsOfURL:[NSURL URLWithString:UrlXml]
encoding:NSUTF8StringEncoding
error:nil];
SBJSON *parser = [[SBJSON alloc] init];
NSDictionary *results = [parser objectWithString:jsonString error:nil];
parser = nil;
If the data you’re receiving from the JSON feed has the literal text
pass\u00e9in it (as 10 ASCII bytes with a literal ‘backslash’ character in it) then the data is not UTF-8 encoded. You should useNSNonLossyASCIIStringEncodinginstead. That encoding will convert\u####sequences to the proper Unicode characters.