I'm trying to make a simple card game but after switching from Win 7 to Xubuntu 14.04 even the most simple things do not work anymore. I tried this for 3 days and still can't solve it.
What happens is that the console is giving me 3 diamond question marks, for the code below.
#define herz "\xe2\x99\xa5"
#define karo "\xe2\x99\xa6"
#define kreuz "\xe2\x99\xa3"
#define pik "\xe2\x99\xa0"
char ch = '0';
I tried this with the code:blocks console and the xubuntu one.
(xterm -T $TITLE -e and xfce4-terminal -T $TITLE -x)
Console LANG is
I tried several fonts and it didn't change a thing. I can type in special characters manually in the console but when C tries to print them it does not work.
%c is used to print single characters. Since you are trying to print strings, use
%s instead. Your print statement will be
You have defined literal constant character strings where you need literal constant wide characters.
const wchar_t herz = L'\ue299a5';
You then need to print using
wprintf() with the
%lc format specifier:
wprintf("%lc%lc%lc%lc", herz, karo, kreuz, pikl) ;