views:

413

answers:

3

Hello,

I have an NSString that then sets a UILabel. This contains unicode such as...

E = MC Hammer\U00ac\U2264

and complete ones such as

\U2013\U00ee\U2013\U00e6\U2013\U2202\U2013\U220f\U2013\U03c0 \U2013\U00ee\U2013\U220f\U2013\U03c0\U2013\U00aa\U2013\U221e\U2014\U00c5

These are not displaying correctly, is there anything I need to do to parse these at all?

A: 

What code are you using to set the NSString? It's possible that the string is not being initialized properly, and that's having a negative impact on the UILabel.

fbrereto
It is in a subclassed UITableViewCell with UILabels created in IB.cell.testLabel.text = [Array objectAtIndex:row];is the code I use to set the text.
Lee Armstrong
My question has to do more with the array of strings -- how is that array populated?
fbrereto
A: 

Hi,

How can we display this unicode string in UILabel.

\U2013\U00ee\U2013\U00e6\U2013\U2202\U2013\U220f\U2013\U03c0 \U2013\U00ee\U2013\U220f\U2013\U03c0\U2013\U00aa\U2013\U221e\U2014\U00c5

any help on this.

Elango
A: 

"U" needs to be a lowercase "u"

Ben Call
lblResult.text = [NSString stringWithFormat:@"\u2013\u220f\u2013\u03c0 \u2013\u00ee\u2013\u220f\u2013\u03c0\u2013\u00aa\u2013\u221e\u2014\u00c5"];
Ben Call
btw... i tested and verified that the U in the unicode character string needs to be lowercase.
Ben Call