samedi 21 février 2015

Converting string with escapes in it to Unicode

I want to take a variable, and add it to a string as a command to make a Unicode character. See below for clarification through pseudo-C++:



for (int i = 0; i <= 50625; i++){

hexcode = dec_to_hex(i+32); //this already works & returns a hex string
unicode_var = U"\u$(hexcode)"; //inserts hexcode into the command for a Unicode char (I used PHPish syntax to help convey this)
}


What do I do to "insert" the variable as a string and get it interpreted as part of a command? Forgive me if this is a stupidly simple question; C++ is still mysterious to me.


Aucun commentaire:

Enregistrer un commentaire