I am trying to parse a feed from a json webservice on my iPhone however the utf8 conversion is not working the way it should or am I doing something wrong
Here is apart of the feed
est un ru00c3u00aave en noir
Here is the code I have written to convert the above:
NSString* str1 = @"est un r u00c3u00aa ve en noir";
NSString* str = [NSString stringWithUTF8String:[str1 cStringUsingEncoding:NSUTF8StringEncoding]];
NSLog(@"Converted UTF %@",str);
This is the output that I am getting:
Converted UTF est un r ?a ve en noir
The expected output should be
Converted UTF est un rêve en noir
When I checked the UTF table and used a utf converter online the output is correctly got with the same code and using the string @"est un ru00EAve en noir"
but I think that the UTF16 Representation if I am not mistaken. Now am really in a fix how to parse this feed.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…