Printing emoji with wprintf() on windows

Viewed 91
#include <locale.h>
#include <stdio.h>
#include <wchar.h>

int main() {
    setlocale(LC_CTYPE, "");
    wprintf(L"٩(◕‿◕。)۶\n");
    wprintf(L"\n");
    return 0;
}

The code above works perfectly on linux exactly as expected:

$ ./a.out
٩(◕‿◕。)۶

but completely breaks on windows:

PS> ./a.exe
()

why does this happen? How do I then, print emojis on windows?

Im using powershell with gcc 9.2.0 on windows and WSL with gcc 9.3.0 on powershell for linux.

0 Answers
Related