Category : unicode

im trying to print a interface using these characters: "╣║╗╝╚╔╩╦╠═╬" but, when i try to print it, returns something like this: "ôöæËÈ" interface.txt unsigned char* tabuleiroImportado() { std::ifstream TABULEIRO; TABULEIRO.open("tabuleiro.txt"); unsigned char tabu[36][256]; for (unsigned char i = 0; i < 36; i++) { TABULEIRO >> tabu[i]; std::cout << tabu[i] << std::endl; } return *tabu; ..

Read more

I’m converting wstring to string with std::codecvt_utf8 as described in this question, but when I tried Greek or Chinese alphabet symbols are corrupted, I can see it in the debug Locals window, for example 日本 became "日本" std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv; //also tried codecvt_utf8_utf16 std::string str = myconv.to_bytes(wstr); What am I doing wrong? Source: Windows Que..

Read more

The code below is supposed to convert a wstring "!" to a string and output it, setlocale(LC_ALL, "Chinese_China.936"); //system("chcp 936"); std::wstring ws = L"!"; string as((ws.length()) * sizeof(wchar_t), ‘-‘); auto rs = wcstombs((char*)as.c_str(), ws.c_str(), as.length()); as.resize(rs); cout << rs << ":" << as << endl; If you run it without system("chcp 936");, the converted string ..

Read more