0

I am using TouchJSON to parse a JSON data.

In the results, the strings in the array are all in \U** format.

Yes, they are meant to be other languages than English.

Why TouchJSON can't just replace them with real string via UTF8?

How should I deal with the results if I want to store them as NSStrings and use them in UILabel?

Thanks

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Jackson Tale
  • 25,428
  • 34
  • 149
  • 271

1 Answers1

1

The leading \u should not be a part of the string, but rather an identifier. If you load an NSString from parsed NSDictionary, it should've ignored the leading \u.

If it did not, you can always use [theString substringFromIndex: 2] to remove any leading identifiers.

Otherwise, take a look at SBJson, an alternative library for Objective-C JSON parsing.

Patrick Perini
  • 22,555
  • 12
  • 59
  • 88