Convert string to Unicode hex representation and back in C++ -
i want convert string string contains characters of given string in unicode hex notation , again. target language c++.
for example, given german word hände
, want able convert string it's unicode hex notation u+0068 u+00e4 u+006e u+0064 u+0065
, , original representation hände
.
how can accomplished in c++?
according comment, stop use simple conversation?
std::u16string in = u"hände"; stringstream out; (auto x : in) out << hex << "u+" << x << " "; cout << out.str();
output:
u+48 u+e4 u+6e u+64 u+65
Comments
Post a Comment