Convert wstring to string encoded in UTF-8

前端 未结 6 1086
囚心锁ツ
囚心锁ツ 2020-11-29 04:19

I need to convert between wstring and string. I figured out, that using codecvt facet should do the trick, but it doesn\'t seem to work for utf-8 locale.

My idea is,

6条回答
  •  抹茶落季
    2020-11-29 04:55

    C++ has no idea of Unicode. Use an external library such as ICU (UnicodeString class) or Qt (QString class), both support Unicode, including UTF-8.

提交回复
热议问题