Saturday, 7 September 2013

Output a Unicode Number in C++ (not the character)

Output a Unicode Number in C++ (not the character)

There's plenty of information out there on how to output unicode
Characters in C++. I'm able to do this with the below code. This outputs a
lower case 'h'.
cout << '\u0068' << endl;
is it possible to go the other way. That is, input a 'h' and have cout
display the 0068 (unicode number) in a console?
I have googled this to death and found nothing. I don't want to build a
lookup table/switch statement etc. I though there may be simple way of
converting unicode characters into their unicode numbers using something
as simple as above. Any clues.

No comments:

Post a Comment