windows 10 code blocks problem

Oct 25, 2017 at 11:31am
I just got from windows 7 to windows 10 programming in c++ and i can't use some of the old ascii characters such as the smiley faces. how can i fix this ? thanks
Oct 25, 2017 at 12:00pm
There is no smiley face in the ASCII character set.

https://en.wikipedia.org/wiki/ASCII#Character_set
Oct 25, 2017 at 12:27pm
The way that characters outside of the range defined by the ASCII standard are displayed will depend on the code page in use.

Commonly used values are 437 and 1252.

You might try
 
    SetConsoleOutputCP( n );

where n is the number of the required code page.

needs #include <windows.h>

See https://docs.microsoft.com/en-us/windows/console/setconsoleoutputcp

https://en.wikipedia.org/wiki/Code_page_437
https://en.wikipedia.org/wiki/Windows-1252
Oct 25, 2017 at 1:17pm
Or just use the Unicode code points: https://en.wikipedia.org/wiki/Code_page_437#Character_set
Topic archived. No new replies allowed.