ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • c++11 표준 UTF8 인코딩
    카테고리 없음 2018. 3. 2. 11:33
    728x90
    std::wstring temp;
    temp.resize(str.size());
    std::locale prevLocale = std::locale::global(std::locale(""));
    temp.resize(std::mbstowcs(&temp[0], &str[0], str.size()));
    std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> convert;
    str = convert.to_bytes(temp);
    std::locale::global(prevLocale);

     

    근데 C++17 에 deprecated 크리먹음 ㅠㅠ

    728x90

    댓글

Designed by Tistory.