locked
Printing Unicode characters on console RRS feed

  • Question

  •  

    Hi,

    I am not able to print the Unicode character on the console.

    I tried with these API's

    1)  wprintf()               displays ???????

    2) _cwprintf()            displays [][][][][][]

    3) WriteConsoleW    displays [][][][][][]

     

    Does anybody knows the solution? Please let me know.

     

    Thanks in advance.

     

    Tuesday, February 26, 2008 2:07 PM

Answers

  • The console window supports UNICODE, but unfortunately the default font used for the console is limited in what characters it can display.

     

    You can replace the font for the console with another of your choice, however it necessarily must be a monospace font.

     

    There is some more information here: http://blogs.msdn.com/michkap/archive/2005/06/29/433669.aspx

     

    Perhaps you can reconsider using the console, and switch to a window where you have much greater choices of fonts available to you.

     

    HTH

     

    Brian

     

    Tuesday, February 26, 2008 8:48 PM
  • All that means is that these fonts don't support the characters you are trying to display.

     

    What kind of characters are you trying to print? Is it a particular language? If so, you may need to download one of the Microsoft Language packs to get the font you are after.

     

    For example, Microsoft Mincho is a great font, fixed-width, which might do the trick for you if you are trying to display Japanese or Chinese.

     

    You might get more sound advice by posting in microsoft.public.win32.programmer.international.

     

    Brian

     

     

     

    Friday, February 29, 2008 4:05 AM

All replies

  • Hi,

    I think this should help:

    https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=225366&SiteID=1
    http://www.thescripts.com/forum/thread748485.html
    Tuesday, February 26, 2008 3:45 PM
  • The console window supports UNICODE, but unfortunately the default font used for the console is limited in what characters it can display.

     

    You can replace the font for the console with another of your choice, however it necessarily must be a monospace font.

     

    There is some more information here: http://blogs.msdn.com/michkap/archive/2005/06/29/433669.aspx

     

    Perhaps you can reconsider using the console, and switch to a window where you have much greater choices of fonts available to you.

     

    HTH

     

    Brian

     

    Tuesday, February 26, 2008 8:48 PM
  • I tried using "Lucida Console" and "Consolas" but it doesn't help.

     

    Thursday, February 28, 2008 7:04 AM
  • All that means is that these fonts don't support the characters you are trying to display.

     

    What kind of characters are you trying to print? Is it a particular language? If so, you may need to download one of the Microsoft Language packs to get the font you are after.

     

    For example, Microsoft Mincho is a great font, fixed-width, which might do the trick for you if you are trying to display Japanese or Chinese.

     

    You might get more sound advice by posting in microsoft.public.win32.programmer.international.

     

    Brian

     

     

     

    Friday, February 29, 2008 4:05 AM