1

I'm trying to map object from a JSON data encoded in latin 9 (ISO/IEC 8859-15) (I can't unfortunately change it to UTF-8)

My JSON data contains some accents, that's why I got an underlyingError form the - (id)parseResponseData:(NSError **)error function in RKResponseMapperOperation.m:

Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" 
(Unable to convert data to string around character 963.) 
UserInfo=0x8258cc0 {NSDebugDescription=Unable to convert data to string around character 963.}

Is there an option to fix it?

PS: this question is linked to this post => Mapping json with RestKit 0.20.3

Community
  • 1
  • 1
Guillaume
  • 393
  • 2
  • 21

1 Answers1

0

If you can't change the source encoding then you should change the text content to HTML encode the characters and then decode them after the JSON has been received and mapped into your destination object.

Wain
  • 118,658
  • 15
  • 128
  • 151