Rob
Rob

Reputation: 1

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 advance.

Upvotes: 0

Views: 335

Answers (2)

Aidan Steele
Aidan Steele

Reputation: 11330

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. &#x6C34 and so on?

If so, there exists a category that can help you with this. Specifically, look at -[NSString stringByDecodingHTMLEntities].

Upvotes: 0

Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39988

decode it again using [NSSting stringWithUTF8String:charPtr];

Upvotes: 1

Related Questions