UTF-8, CString and CFile? (C++, MFC)

前端 未结 3 722
说谎
说谎 2020-12-07 22:10

I\'m currently working on a MFC program that specifically has to work with UTF-8. At some point, I have to write UTF-8 data into a file; to do that, I\'m using CFiles and CS

3条回答
  •  执笔经年
    2020-12-07 22:29

    You'll have to convert sWorkingLine to UTF-8 and then write it in the file.

    WideCharToMultiByte can convert unicode strings to UTF-8 if you select the CP_UTF8 codepage. MultiByteToWideChar can convert ASCII chars to unicode.

提交回复
热议问题