Well, GNOME Terminal is set to UTF-8, please look at the following:
Code:
nazgulled@nazbox ~ $ cat utf8-normal.c
#include <stdio.h>
int main(void) {
// Card suits in black
char clubs[] = {0xE2, 0x99, 0xA7, 0};
char diamonds[] = {0xE2, 0x99, 0xA2, 0};
char hearts[] = {0xE2, 0x99, 0xA1, 0};
char spades[] = {0xE2, 0x99, 0xA4, 0};
printf("\n%s\n%s\n%s\n%s\n", clubs, diamonds, hearts, spades);
printf("\náàâãéèêíìîĩóòôõúùûũç\n\n");
printf("\nÁÀÂÃÉÈÊÍÌÎĨÓÒÔÕÚÙÛŨÇ\n\n");
return 0;
}
nazgulled@nazbox ~ $ cat utf8-ncurses.c
#include <ncurses.h>
int main(void) {
initscr();
// Card suits in black
char clubs[] = {0xE2, 0x99, 0xA7, 0};
char diamonds[] = {0xE2, 0x99, 0xA2, 0};
char hearts[] = {0xE2, 0x99, 0xA1, 0};
char spades[] = {0xE2, 0x99, 0xA4, 0};
printw("\n%s\n%s\n%s\n%s\n", clubs, diamonds, hearts, spades);
printw("\náàâãéèêíìîĩóòôõúùûũç\n\n");
printw("\nÁÀÂÃÉÈÊÍÌÎĨÓÒÔÕÚÙÛŨÇ\n\n");
getch();
endwin();
return 0;
}
Now the following:
Code:
nazgulled@nazbox ~ $ gcc utf8-normal.c -o utf8-normal
nazgulled@nazbox ~ $ gcc -lncurses utf8-ncurses.c -o utf8-ncurses
nazgulled@nazbox ~ $ ./utf8-normal
♧
♢
♡
♤
áàâãéèêíìîĩóòôõúùûũç
ÁÀÂÃÉÈÊÍÌÎĨÓÒÔÕÚÙÛŨÇ
nazgulled@nazbox ~ $ ./utf8-ncurses
�~Y�
�~Y�
�~Y�
�~Y�
áàâãéèêíìîĩóòôõúùûũç
�~A�~@�~B�~C�~I�~H�~J�~M�~L�~NĨ�~S�~R�~T�~U�~Z�~Y�~[Ũ�~G
See? Dunno what else to tell you... nor do I know how can I fix this!