• 0

Decode a UTF-8 file to a CString?


Question

I?d like to Decode a UTF-8 string to a regular CString. I?m using MFC and don?t really know where to start.

I'm reading a UTF-8 coded file using CStdioFile and CFile.

Has the _T(???) something to do with it?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

_T is a macro to help you in not having to rewrite your string code for MBCS, Unicode, or SBCS. It becomes a compiler switch to enable support for different character sets. So, all your literals should be wrapped in _T().

Depending upon which version of MFC you link against, CString will map to a wchar_t, otherwise, it maps to char. That said, it shouldn't matter what your data file is. MFC **should** handle it. Essentially, data becomes portable.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.