I have a string called str
containing the hex code 265A
and I would like to output it as a Unicode character, which should be the black chess king.
So these are the ways I have already tried:
std::string str = "\u" + str;
std::cout << str;
but this gives me the error
error: incomplete universal character name \u
Doing
std::cout << "\u" << str;
also didn't work, for the same reason.
So I tried using wchar_t
like this:
wchar_t wc = strtol(str.c_str(), NULL, 16);
std::wcout << wc;
but that just didn't output anything.
So I really don't know what else to do.