Question

I am currently writing a C application and I need to display the following symbols in the terminal : and

Their ASCII character codes are 242 and 243 but I can't get them to be displayed in the DOS terminal.

Any ideas on how I can do this?

Was it helpful?

Solution

printf("\xf2\n");

If that doesn't work, it's because of DOS and code pages. Try playing with the CHCP command. You're strolling into locales/platform-specific/give-up-now territory.

OTHER TIPS

These are not in ASCII nor in LATIN1 for instance.

What DOS terminal? If you're compiling to a 32-bit (or 64-bit) binary under Windows, as I'm sure you are, then it's just a console window.

I believe this is the simplest way to set the code page of a console window. It's up to you whether to use code page 437 or a unicode code page (such as UTF-8, which is 65001), but I would suggest Unicode as it will give you more flexibility if you need it later.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top