iPhone: Decode characters like \U05de
I used SBJsonParser to parse a json string. inside, instead of hebrew chars, I got a str开发者_如何学Going full of chars in a form like \U05de what would be the best way to decode these back to hebrew chars, so i can put these on controls like UIFieldView?
Eventually I ran a loop iterating in the string for the chars \u
in the loop, when detected such a substring, i took a range of 6 characters since that index,
giving me a substring for example \u052v that need to be fixed.
on this string, i ran the method [str JSONValue]
, which gave me the correct char, then i simply replaced all occurrences of \u052v (for example) with the latter corrected char.
精彩评论