デコードする必要があるものの例があります:
@"für"
これを NSString にデコードして次のようにするにはどうすればよいですか
毛皮
私は多くのことを試しました
[@"für" stringByDecodingHTMLEntities] > für
[@"für" gtm_stringByUnescapingFromHTML] > für
しかし運がない。
ありがとう!
vikingosegundoのソリューションに基づく更新
NSLog(@"möchte decoded to : > %@", [@"möchte" stringByEncodingHTMLEntities] );
NSLog(@"möchte decoded to: > %@", [@"möchte" stringByDecodingHTMLEntities] );
NSLog(@"für decoded to : > %@", [@"für" stringByEncodingHTMLEntities] );
NSLog(@"für decoded to: > %@", [@"für" stringByDecodingHTMLEntities] );
NSLog(@"möchte decoded:%@", [@"möchte" stringByDecodingHTMLEntitiesComma] );
NSLog(@"für decoded:%@", [@"für" stringByDecodingHTMLEntitiesComma] );
möchte decoded to : > möchte
möchte decoded to: > möchte
für decoded to : > für
für decoded to: > für
möchte decoded:möchte
für decoded:für
注 : stringByEncodingHTMLEntities はhttps://github.com/mwaterfall/MWFeedParser/tree/master/Classesからのものです。 stringByDecodingHTMLEntitiesComma は vikingosegundo のカテゴリからのものです。