none
Display chinese character is not working :(

    Question

  •  

    Hi all,

     

    In my windows forms app, I do:

     

    MessageBox.Show(('\u5143').ToString());

     

    This should display the chinese currency symbol (for the Yuan), but instead it displays a square box.

     

    I thought .NET supported unicode. What could be wrong?

     

    Thanks

     

    Saturday, August 09, 2008 3:09 PM

Answers

  • I HOPE that you do not have windows vista, if you do, I hope that you have windows vista premium or better.  To show chinese characters, you must go to control panel -> regional language settings. 

     

    XP:

     

    1. On the Languages tab, select the checkbox labeled Install files for East Asian languages.

    2. Click OK when a dialog box appears informing you of the storage requirements for the language files (230 MB).

    3. Click OK on the Languages tab

     

    If you have Vista, this is ONLY available if you have windows vista premium or higher.  It is not available if you use windows vista home.

     

    Bob

    Saturday, August 09, 2008 4:42 PM
  • Bob already told you the solution; I'm going to tell you what exactly is happening (ie: why are you seeing the square instead of the symbol):
    .Net supports perfectly Unicode: this means that you can use strings made of any combination of Unicode characters (except invalid surrogate combinations, which are not actual Unicode characters), and these strings can be properly handled. However, from the .Net perspective, characters are just a form of data: .Net knows well how to work with such data, but it doesn't define how to render each character: that's what typefaces or fonts are for. However, the default fonts in your system do not have a glyph (ie: a visual representation) for the \u5143 character, so the default square placeholder is shown instead. If you are running Windows XP, the steps provided by Bob will install several fonts on your system which do support eastern scripts (chinesse, japanesse, and others); but since there are so many characters, and some different fonts, it will take a nice ammount of space (namely, those 230Mb it warns you about). Ok, with modern hard drives in the hundreds of gigabytes, 230Mb doesn't seem worth a warning; but remember that XP has been out there since 2001; and that 230Mb is still a lot for just "fonts".
    Keep in mind that, while you might install asian-languages support fonts in Windows, there aren't any fonts in Windows (and I haven't found any on the whole web neither) that support the entire Unicode character range. For example, you are likelly to have some trouble if you try to use the Mathematical Alphanumeric Symbols block.

    I hope this sheds a bit of ligth on the topic Wink
    Saturday, August 09, 2008 10:23 PM

All replies

  • I HOPE that you do not have windows vista, if you do, I hope that you have windows vista premium or better.  To show chinese characters, you must go to control panel -> regional language settings. 

     

    XP:

     

    1. On the Languages tab, select the checkbox labeled Install files for East Asian languages.

    2. Click OK when a dialog box appears informing you of the storage requirements for the language files (230 MB).

    3. Click OK on the Languages tab

     

    If you have Vista, this is ONLY available if you have windows vista premium or higher.  It is not available if you use windows vista home.

     

    Bob

    Saturday, August 09, 2008 4:42 PM
  • Bob already told you the solution; I'm going to tell you what exactly is happening (ie: why are you seeing the square instead of the symbol):
    .Net supports perfectly Unicode: this means that you can use strings made of any combination of Unicode characters (except invalid surrogate combinations, which are not actual Unicode characters), and these strings can be properly handled. However, from the .Net perspective, characters are just a form of data: .Net knows well how to work with such data, but it doesn't define how to render each character: that's what typefaces or fonts are for. However, the default fonts in your system do not have a glyph (ie: a visual representation) for the \u5143 character, so the default square placeholder is shown instead. If you are running Windows XP, the steps provided by Bob will install several fonts on your system which do support eastern scripts (chinesse, japanesse, and others); but since there are so many characters, and some different fonts, it will take a nice ammount of space (namely, those 230Mb it warns you about). Ok, with modern hard drives in the hundreds of gigabytes, 230Mb doesn't seem worth a warning; but remember that XP has been out there since 2001; and that 230Mb is still a lot for just "fonts".
    Keep in mind that, while you might install asian-languages support fonts in Windows, there aren't any fonts in Windows (and I haven't found any on the whole web neither) that support the entire Unicode character range. For example, you are likelly to have some trouble if you try to use the Mathematical Alphanumeric Symbols block.

    I hope this sheds a bit of ligth on the topic Wink
    Saturday, August 09, 2008 10:23 PM
  •  

    Thanks guys. Very helpful answers.

     

    I installed the East Asian Languages support and the chinese currency symbol displays just fine.

     

    Saturday, August 23, 2008 8:17 PM