0

Why does my app draw 'á' as '&aacute' in a UILabel.

I parse the text off a webpage and then draw the text into a label.

Is there something I am missing?

Many Thanks -Code

1 Answers1

2

This is because the data in the web page is HTML entity encoded so that á is expressed asá. However, as the UILabel doesn't parse/display HTML, it simply displays the content as-is.

As such, you'd need to entity decode the data (to convert á back to á) prior to displaying it. The existing HTML character decoding in Objective-C / Cocoa Touch question/answers (and other questions it links to) should be of some assistance.

Community
  • 1
  • 1
John Parker
  • 54,048
  • 11
  • 129
  • 129