Printing unicode characters in PowerShell via a C++ program Printing unicode characters in PowerShell via a C++ program powershell powershell

Printing unicode characters in PowerShell via a C++ program


From the printf docs:

wprintf and printf behave identically if the stream is opened in ANSI mode.

Check out this blog post. It has this nice short little listing:

#include <fcntl.h>#include <io.h>#include <stdio.h>int main(void) {    _setmode(_fileno(stdout), _O_U16TEXT);    wprintf(L"\x043a\x043e\x0448\x043a\x0430 \x65e5\x672c\x56fd\n");    return 0;}