S
S
sddvxd2018-06-26 01:56:38
C++ / C#
sddvxd, 2018-06-26 01:56:38

How to output Cyrillic from wstring?

Hello

std::wifstream wif("C:\\cpp\\permission.txt");
    if (wif.is_open())
    {
      wif.imbue(std::locale(std::locale(), new std::codecvt_utf8<wchar_t,0x10ffff, std::consume_header>));

        std::wstring wline;
        while (std::getline(wif, wline))
        {
            LPCWSTR wline2 = wline.c_str();
            MessageBoxW(FindWindowW(NULL, L"Корзина"), NULL, wline2, MB_YESNO);
        }

        wif.close();
    }

A bunch of Chinese characters are displayed in the box

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question