Print wchar to Linux console?
问题 My C program is pasted below. In bash, the program print "char is ", Ω is not printed. My locale are all en_US.utf8. #include <stdio.h> #include <wchar.h> #include <stdlib.h> int main() { int r; wchar_t myChar1 = L'Ω'; r = wprintf(L"char is %c\n", myChar1); } 回答1: This was quite interesting. Apparently the compiler translates the omega from UTF-8 to UNICODE but somehow the libc messes it up. First of all: the %c -format specifier expects a char (even in the wprintf-version) so you have to