Double decoding Objective C/iPhone
does someone know how i can correctly decode double encoded UTF8 strings? I use the NSXMLParser which decodes it once but after that i'm stuck with a string showing UTF8 encoded characters.
Thanks in ad开发者_JAVA百科vance.
decode it again using [NSSting stringWithUTF8String:charPtr];
What precisely do you mean by "decode double encoded UTF-8 strings"? By a string "showing UTF-8 encoded characters", do you mean character entity references, e.g. 水
and so on?
If so, there exists a category that can help you with this. Specifically, look at -[NSString stringByDecodingHTMLEntities]
.
精彩评论