Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
580 views
in Technique[技术] by (71.8m points)

iphone - Does IOS support all Unicode emojies?

Hello All,

I have a problem regarding Unicode characters. I'm able to append Apple Art Work Unicode Characters in UITextView. Like this : -

self.textView.text = @"ue00A";

It is Okay. But now i have many Unicodes Characters which're not in Apple art work.
One of them is U+1F3C7
Now I'm trying to show it in UITextView.

self.textView.text = @"u1f3c7"; 

Then it is showing me an Special Character instead of Emoji.
Unicode Emoji

This is the Emoji Icon of this Unicode But it is showing me ?7.

Apple doesn't support all Unicode Characters ?
How can I add my own emojies in my application ?

Let me know if my question is not clear for you.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Doesn't Objective-C use UTF-16 internally, like Java and C#?

If so, then U+1F3C7 wouldn't be "u1f3c7", but the surrogate-pair, "uD83CuDFC7".

Otherwise, there has to be some way to indicate a higher character, because "u1f3c7" is the same as "u1f3c" + "7", which is ?7 (capital iota with psili and oxia, then 7).

Edit: After some discussion between the OP and myself, we figured out that the way to do this in Objective C is one I know as the C++ way:

"U0001F3C7"

(uXXXX with a small u and 4 hex digits works if it fits in thos 4 hex digits, UXXXXXXXX with a capital U and 8 hex digits works for everything, but is longer to type).

Now our friend just needs to deal with the matter of font support, which alas is another problem in getting this to actually look as he wants.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...