سؤال

I'm adding currency symbols to a ListView and finding that all symbols display properly, with the exception of those for India and Turkey, which display a box character. In the debugger, these currency symbols display properly. I tried setting the ListView font to the same font as the debugger (Consolas) but that didn't work. I also tried a Label control instead of the ListView, and found the same issue, so it is presumably not working for all Winforms controls. What am I missing?

// Jordan
// Displays correctly
label1.Text = new RegionInfo( "ar-JO" ).CurrencySymbol;

// India: as-IN, bn-IN, en-IN, gu-IN, hi-IN, kn-IN, kok-IN,
//        ml-IN, mr-IN, or-IN, pa-IN, sa-IN, ta-IN, te-IN
// Displays a box symbol
label1.Text = new RegionInfo( "pa-IN" ).CurrencySymbol;

// Turkey
// Displays a box symbol
label1.Text = new RegionInfo( "tr-TR" ).CurrencySymbol;
هل كانت مفيدة؟

المحلول

Some fonts (including popular MS Sans Serif, Tachoma) don't have U+2089 and/or U+20BA glyphs (that are Indian an Turkish currency symbols), while some other (e.g. Calibri) have. It seems, that you have to change label1.Font.Name

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top