问题
I would like to print that kind of character, but I dont get it, I thought c# supports unicode.
The way I solved it:
label3.Text = "\u1F6B5";
This is not the only symbol ,which does not work.
Thank you.
回答1:
label3.Text = "\u1F6B5";
The \u
escape takes only 4 hex digits, you are trying to use 5. So you end up with a string that contains two characters, '\u1F6B' and '5'. Looks like "Ὣ5", not what you want.
Using codepoints from the upper bit planes (codes >= 0x10000) require a capital U to get properly encoded into a string literal. Fix:
label3.Text = "\U0001F6B5";
The machine also needs a font that contains the glyph. You'll know it is missing when you see a rectangle instead.
回答2:
I believe you also need to select a font that supports the unicode character for your label. Try something like Arial Unicode MS (or take a look at this guideline for fonts supporting that exact unicode character... e.g. the Segoe UI Symbol font).
来源:https://stackoverflow.com/questions/31690885/unicode-special-character-not-displaying-in-label