Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,706
6,289
On Mac OS X Lion, I'm able to access various country flags in the AppleColorEmoji font. When I display a string containing the glyphs in a UITextView that has the font property set to AppleColorEmoji, they get replaced with two, separate, boxed in characters.

For example, the Japanese flag glyph gets replaced with a boxed in J and a boxed in P.

Does anyone know why this is and/or how I can remedy it? Because my application is intended to be one that users may copy/paste strings from, making the glyph instead be a UIImage would not be an acceptable remedy.

For now, I'm thinking I just won't have the flags included.
 
For example, the Japanese flag glyph gets replaced with a boxed in J and a boxed in P.

This looks like a character-encoding problem. Are you testing on an iDevice or on the emulator?

What unicode code-point does Lion report for the Japanese flag? What unicode code-point is in the NSString? Try using "\uXXXX" instead of pasting a glyph there (to eliminate encoding issues).

The boxed 'J' and 'P' are unicode code-points U+1F1EF and U+1F1F5. See: http://unicode.org/charts/PDF/U1F100.pdf.

The Japanese flag glyph is U+E50B on iDevices. See: http://hasseg.org/stuff/ios-emoji/.

Hope this helps :)
 
This looks like a character-encoding problem. Are you testing on an iDevice or on the emulator?

What unicode code-point does Lion report for the Japanese flag? What unicode code-point is in the NSString? Try using "\uXXXX" instead of pasting a glyph there (to eliminate encoding issues).

The boxed 'J' and 'P' are unicode code-points U+1F1EF and U+1F1F5. See: http://unicode.org/charts/PDF/U1F100.pdf.

The Japanese flag glyph is U+E50B on iDevices. See: http://hasseg.org/stuff/ios-emoji/.

Hope this helps :)

Wow, thanks :)

I'm surprised Apple decided to map the emoji flags differently in iOS than in Lion, but included them in both.
 
Also, be aware that iOS devices are limited in fonts they support. See this page for more info. Therefore, if the font you are using doesn't support your emoji characters, neither will your device.
 
Wow, thanks :)

I'm surprised Apple decided to map the emoji flags differently in iOS than in Lion, but included them in both.

I did some more research:

http://en.wikipedia.org/wiki/Emoji#Emoji_in_the_Unicode_standard

Wikipedia said:
Hundreds of Emoji characters were encoded in the Unicode Standard in version 6.0 released in October 2010...

http://en.wikipedia.org/wiki/Regional_Indicator_Symbol

Wikipedia said:
Although they can be displayed as Roman letters, it is intended that implementations may choose to display them in other ways, such as by using national flags.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.