mercredi 20 mars 2019

c++11 how to convert a hex string into unicode string

Seems that even with C++11 this is not straightforward to do, e.g.,

string instring = "0x1234";  // hex string
string outstring = "ሴ"       // equivalent to "\u1234"

Assuming I only have this hexadecimal number as an input string, what's the best way to achieve this?

Looks like this '\u' prefix only works when immediately followed by the hex number.

Aucun commentaire:

Enregistrer un commentaire