2

I want to get the characters of Unicode in C#

e.g

char ch1 = '\u2085';  
char ch2 = '\u2086';
char ch3 = '\u2087';
char ch4 = '\u2088';
char ch5 = '\u2089';

but it return boxes instead of symbols (₈ ₇ ₆ ₅)

How to return the symbols?

meer
  • 932
  • 1
  • 10
  • 11

1 Answers1

4

Those characters are correctly identifying the unicode characters, but whatever medium you're rendering those characters into is not rendering them correctly. I just tried outputting the characters in your code into a LINQPad window, and it comes out as unicode.

char ch1 = '\u2085';  
char ch2 = '\u8328';
char ch3 = '\u8327';
char ch4 = '\u8326';
char ch5 = '\u8325';
Console.WriteLine("" + ch1 + ch2 + ch3 + ch4 + ch5);

Output:

₅茨茧茦茥

StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
  • 2
    When characters appear as small boxes, it’s usually a font problem: the font used does not contain glyphs for them. [Font support to subscript characters](http://www.fileformat.info/info/unicode/char/2080/fontsupport.htm) is relatively limited. – Jukka K. Korpela Nov 05 '13 at 06:01