Search code examples
ccharacter-encodingwindows-consoleeuro

unable to print euro symbol in a "C" program


I am unable to print the euro symbol. The program I am using is below.

I have set the character set to codepage 1250 which has 0x80 standing for the euro symbol.

Program
=======

#include <stdio.h>
#include <locale.h>

int main()
{
    printf("Current locale is: %s\n", setlocale (LC_ALL, ".1250"));
    printf("Euro character: %c\n", 0x80);
    getchar();
    return 0;
}

Output
======
Current locale is: English_India.1250
Euro character: ?

Other details
=============
OS: Windows Vista
Compiler: vc++ 2008 express edition


Solution

  • Read this: http://www.columbia.edu/~em36/wpdos/eurodos.html

    There are sections, which could help you a lot:

    • Display the euro-symbol in full-screen DOS and command consoles in Windows NT, 2000, or XP
    • Display the euro symbol in DOS and command console windows in Windows 2000 and XP (built-in support for TrueType fonts)
    • Display the euro in DOS and command consoles in Windows 2000 and XP (bitmap and TrueType fonts)