Question

in xml data is

<content_special>
    SAT 17TH TEST test club cheap drinks £3 shots £5 bottles $beers
</content_special>

i get this string using this code

TBXMLElement *Content_Special=[TBXML childElementNamed:@"content_special" parentElement:Club];
            NSString *Content_SpecialStr = [TBXML textForElement:Content_Special];

when i NSLog(@"Content_special:%@",Content_SpecialStr);

that print like this

 Content_special:SAT 17TH TEST&#13;
test club&#13;
cheap drinks&#13;
&#13;
&#163;3 shots&#13;
&#163;5 bottles&#13;
&#13;
$beers

how can i get original sting which Display in Xlm ? Any suggestion...

Was it helpful?

Solution

Found Solution Using Google Toolbox for Mac GTMNSString+HTML.h ,GTMNSString+HTML.m And GTMDefines.h,

First #import "GTMNSString+HTML.h"

use like This: Content_SpecialStr = [Content_SpecialStr gtm_stringByUnescapingFromHTML];

OTHER TIPS

Ensure your data xml file has utf-8 encoding http://www.w3schools.com/xml/xml_encoding.asp

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top