I'm having a problem with NSJSONSerialization reading JSON from the Met Office Datapoint API.
I get the following error
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Unable to convert data to string around character 58208.
I have checked and think this is the offending line according to the character position
{"id":"353556","latitude":"57.1893","longitude":"-5.0929","name":"Sóil Chaorainn"}
The JSON itself appears to be valid according to a couple of Validators I tried, and I would expect it too be from a large organisation such as Met Office.
Shouldn't NSJSONSerialization work fine with characters such as 'ó'?
If not how do I go about changing the encoding type to deal with this?
Many Thanks in Advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…