I am trying to output things like 안, 蠀, ☃ from C
#include <wchar.h>
int main()
{
fwprintf(stdout, L"안, 蠀, ☃\n");
return 0;
}
output is ?, ?, ?
How do I print those characters?
Edit:
#include <wchar.h>
#include <locale.h>
int main()
{
setlocale(LC_CTYPE, "");
fwprintf(stdout, L"안, 蠀, ☃\n");
return 0;
}
this did the trick. output is 안, 蠀, ☃ . except that the chinese character and snowman appears as box in my urxvt probably because I did not enable those locales.
$ locale -a
C
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
ja_JP.utf8
ko_KR
ko_KR.euckr
ko_KR.utf8
korean
korean.euc
POSIX
zh_CN.utf8
which locale do I have to enable additionally so that it'll display chinese character and snowman? maybe do I need font?
will the above program work on Windows?