Unicode characters

Hello,

A friend of mine is taking his first steps on the language C and is using Dev C++ as compiler.
He started to write a very simple program that shows some special characters.
For example '\x1E' (Alt30) normally shows a triangle.
On his Win10 system, when he runs the program, a questionmark in a rectangle is shown instead of a triangle.
If he opens notepad and give an alt 30, the symbol shows correctly as a triangle.
On my Win8 with the same compiler and the same program the triangle shows normal.
I spend a lot of time surfing the net to find a solution but noting is working.
Can someone help us to understand (and solve) the problem? It seems that the Win10 is not taking the right codepage.

Thanx


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include<stdio.h>
#include<string.h> 
#include<stdlib.h> 
#include<dos.h> 
#include<windows.h> 

main()
{

 SetConsoleCP(CP_UTF8);
    SetConsoleOutputCP(CP_UTF8);
static char gnd[] =                    
	    { '\x1E', '\x1F', '\xDB', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27' };


	   printf("%s\n", gnd);
}
		
This might be the reason.
If the current font is a fixed-pitch Unicode font, SetConsoleOutputCP changes the mapping of the character values into the glyph set of the font, rather than loading a separate font each time it is called. This affects how extended characters (ASCII value greater than 127) are displayed in a console window. However, if the current font is a raster font, SetConsoleOutputCP does not affect how extended characters are displayed.
https://docs.microsoft.com/en-us/windows/console/setconsoleoutputcp
Topic archived. No new replies allowed.