Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm working in Window's console and it seems that window does not support utf-8 characters such as character 0x80 which is € but it the window console it shows blank.

Note that I'm using wcout and I just want to show the correct character for range 0x80 to 0xff

What I have tried:

I'm programming this in C++ and using the Code::Blocks IDE with mingw compiler.

I tried adding SetConsoleOutputCP(CP_UTF8) to my main code. After that the characters above 0x7f are blank, if I try to remove the line
SetConsoleOutputCP(CP_UTF8)

Then, the character 0x80 will change to Ç, instead of €.

Thanks.
Posted
Updated 16-Jun-20 22:30pm
v3
Comments
[no name] 17-Jun-20 4:22am    
pvzzombs 17-Jun-20 4:27am    
@0x01AA BTW, thanks how about for C++?

1 solution

That's because the Console font doesn't support them - you would need to select a different font, which isn't trivial: Set font text in console application[^]
This may help you select an appropriate font: https://www.tenforums.com/tutorials/93961-change-console-window-font-font-size-windows.html[^]

Be aware that a Console app needs an non-proportional font - most of the WIndows ones are proportional so it looks good as text instead of lining up in columns:
Non-proportional, 12pt:
The quick brown fox jumps over the lazy dog
This is text to show the different lengths.


Proportional, 12pt:
The quick brown fox jumps over the lazy dog
This is text to show the different lengths.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900