can't get "wcout" to print unicode string in multiple code pages, together with leaving "cout" to work
please help me get these 3 lines to work together.
std::wcout<<"abc "<<L'\u240d'<<" defg "<<L'א'<<" hijk"<<std::endl;std::cout<<"hello world from cout! \n";std::wcout<<"hello world from wcout! \n";
output:
abc hello world from cout!
i tried:
#include <io.h> #include <fcntl.h>_setmode(_fileno(stdout), _O_U8TEXT);
problem:"wcout" failed
tried:
std::locale mylocale("");std::wcout.imbue(mylocale);
and:
SetConsoleOutputCP(1251);
and
setlocale(LC_ALL, "");
and
SetConsoleCP(CP_UTF8)
Nothing worked