Win32 C++ Code Converting Between Unicode UTF-16 and UTF-8 Using CStringW/A
March 18, 2015 ยท View on GitHub
by Giovanni Dicanio
Description
C++ code that wraps the Win32 APIs MultiByteToWideChar() and WideCharToMultiByte() in a convenient way, using ATL/MFC CString(A/W) classes.
This code can be used for Unicode conversions between UTF-16 and UTF-8.

ATL/MFC string classes are used, in particular:
CStringAis used to store UTF-8 textCStringWis used to store UTF-16 ("wide") text
The reusable code can be found in the UnicodeConvAtl.h and UnicodeConvAtl.cpp files.