I wrote the following code to generate Unicode symbols for card suits in C. I don't need to change the font family or the code page of the console (I use Windows 10 and Dev-C++) but it seems that I can generate only those symbols.
For instance, if I try other known good Unicode values which correspond to existing glyphs (i.e. chess board pieces, dice faces, dominos or others more 'rare' or less commonly used symbols) as shown here in the black photo below my code, the symbols will not render for me locally on my screen.
Why can I not see the symbols?
Here is my C code which prints out all 4 cards regardless of switch/case decision:
#include <stdio.h>
#include <fcntl.h>
#define SPADE L"\u2660"
#define CLUB L"\u2663"
#define HEART L"\u2665"
#define DIAMOND L"\u2666"
enum SUIT {spade = 1, club, heart, diamond};
void printSuit(int suitToSelect){
_setmode((_fileno(stdout), _O_U16TEXT);
switch (suitToSelect){
case spade:
wprintf(SPADE);
break;
case club:
wprintf(CLUB);
break;
case heart:
wprintf(HEART);
break;
case diamond:
wprintf(DIAMOND);
break;
}
_setmode(_fileno(stdout), _O_TEXT);
}
int main(void){
printSuit(spade);
printSuit(heart);
printSuit(club);
printSuit(diamond);
printf("\n");
printf("Normal text\n");
return 0;
}