Iphone - display coded characters like å, ä, ö in UILabel

I have a list that uses UILabel for each of its lines. If I try to display special characters such as å, ä, ö, it displays them as & aring & auml & ouml. How to convert them to UTF8 encoded NSString?

+1
source share
1 answer

Characters render correctly in WebView because HTML objects are correctly interpreted by it.

Perhaps this convenient NSString category will help you display the text as you want in UILabel:

https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString+HTML.m

Import the NSString + HTML.h and NSString + HTML.m files, then use in your class

#import "NSString+HTML.h"

NSString *decodedString = [encodedString stringByDecodingHTMLEntities];

EDIT:

HerbertHansen Apple,

+4

All Articles