c++How to use utf-8 and/or utf-32 in c++ without wchar without stuff like ICU (gcc/cl compilers)?

316 views Asked by At

I have tried many things but they don't seem to work.

#include <iostream>
#include <locale>

using namespace std;

int main() {
    setlocale(LC_ALL, "en-US.utf8");
    std::string uni = u8"ユチエフー8";
    std::cout << uni;

    std::cin.get();
    return 0;

}

Please note that I want utf-8/utf-32 to work not in just this situation but most of the situations without using things like wide characters.

0

There are 0 answers