I'd like to print characters in UTF 8, for example the ಚ (U+0C9A) character. I have the following program which is supposed to work, yet it either prints out a '?' or nothing at all, depending on the terminal. I tried windows terminal, command prompt and powershell as well. Can you help me?
#include <stdio.h>#include <string.h>#include <locale.h>#include <wchar.h>void utf8(){ setlocale(LC_CTYPE, "en_US.UTF-8"); wchar_t ch = 0x0C9A; wprintf(L"Character for U+0C9A: %lc\n", ch);}int main(){ utf8(); return 0;}