Search code examples
objective-cnsdatansjsonserializationnsstringencoding

How can I tell the NSStringEncoding of NSData from NSJSONSerialization?


I have NSData from +[NSJSONSerialization dataWithJSONObject:options:error:]. How is the data encoded?


Solution

  • Look at the comment above the method in the .h file:

    The resulting data is a encoded in UTF-8.