i am trying to show \u1F318 in my application. but iphone app just use first 4 digit and and create the image. Can any one guide me what i am doing wrong to show image of unicode \u1F318 in iPhone.
[(OneLabelTableViewCell *)cell textView].text = @"\u1F318";
out in application is
Note: this answer is based on my experience of Java and C#. If it turns out not to be useful, I'll delete it. I figured it was worth the OP's time to try the options presented here...
The \u
escape sequence always expects four hex digits - as such, it can only represent characters in the Basic Multilingual Plane.
If this is Objective-C, I believe that supports \U
followed by eight hex digits, e.g. \U0001F318
. If so, that's the simplest approach:
[(OneLabelTableViewCell *)cell textView].text = @"\U0001F318";
If that doesn't work, it's possible that you need to specify the character as a surrogate pair of UTF-16 code points. In this case, U+1F318 is represented by U+D83C U+DF18, so you'd write:
[(OneLabelTableViewCell *)cell textView].text = @"\uD83c\uDF18";
Of course, this is assuming that it's UTF-16-based...
Even if that's the correct way of representing the character you want, it's entirely feasible that the font you're using doesn't support it. In that case, I'd expect you to see a single character (a question mark, a box, or something similar to represent an error).
(Side-note: I don't know what @
is used for in Objective-C. In C# that would stop the \u
from being an escape sequence in the first place, but presumably Objective-C is slightly different, given the code in your question and the output.)
See more on this question at Stackoverflow