是
<content_special>
SAT 17TH TEST test club cheap drinks £3 shots £5 bottles $beers
</content_special>
我使用此代码获取此字符串
TBXMLElement *Content_Special=[TBXML childElementNamed:@"content_special" parentElement:Club];
NSString *Content_SpecialStr = [TBXML textForElement:Content_Special];
当我NSLog(@"Content_special:%@",Content_SpecialStr);
像这样打印
Content_special:SAT 17TH TEST
test club
cheap drinks
£3 shots
£5 bottles
$beers
我怎样才能获得Xlm中显示的原始刺痛?任何建议......
答案 0 :(得分:3)
使用Google Toolbox for Mac找到解决方案GTMNSString+HTML.h,GTMNSString+HTML.m和GTMDefines.h,
首先#import "GTMNSString+HTML.h"
像这样使用:Content_SpecialStr = [Content_SpecialStr gtm_stringByUnescapingFromHTML];
答案 1 :(得分:0)
确保您的数据xml文件具有utf-8编码http://www.w3schools.com/xml/xml_encoding.asp