C++: how to convert ASCII or ANSI to UTF8 and stores in std::string
My company use some code like this: std::string(CT2CA(some_CString)).c_str() which I believe it converts a Unicode string (whose type is CString)into ANSI encoding, and this string is for a email's subject. However, header of the email (which includes the subject) indicates that the mail client should decode it as a unicode (this is how the original code does). Thus, some German chars like "ä ö ü" will not be properly displayed as the title. Is there anyway that I can put this header back to UTF8 and store into a std::string or const char*? I know there are a lot of smarter ways to do this,