Convert CString to std::string and back
Flaviu_
1,031
Reputation points
I have the following string (got from an method):
ÉÛ3òBc ß™ î²íÈ. Á:˜"´ÑÌç°A×üí„2 91Nÿ
This is not quite ASCII, I am aware of that.
Now, If I convert it as CString:
CString s1(dec.c_str(), dec.size());
and then convert back:
std::string t1 = CStringA(s1);
I got:
TRACE("%d|%d|%d\n", dec.size(), s1.GetLength(), t1.size());
80|80|37
which is not the same. My question is: how can convert this strange std::string dec to CString and then back in order to get it back exactly the same ?
Developer technologies C++
3,971 questions
Sign in to answer