I searched a lot, but couldn't find anything:
unsigned int unicodeChar = 0x5e9; unsigned int utf8Char; uni2utf8(unicodeChar, utf8Char); assert(utf8Char == 0xd7a9); Is there a library (preferably boost) that implements something similar to uni2utf8?
unsigned ints of 32-bits in size. Each code unit is 8 bits in size; therefore, the way to store a Unicode codepoint in UTF-8 is as a sequence of code units. A string, not an integer.