I need a way to convert chars into hex values as strings.
I've tried a few ways but all of them just ignored UTF8 characters.
For example:
Take character:
Ş
If its converted correctly, its hex value is 0x15E
but this code just returns me 0x3F
which is just character ?
.
wchar_t mychar = 'Ş';
cout << hex << setw(2) << setfill('0')
<< static_cast<unsigned int>(mychar);
I've found a javascript function which exactly what i need but couldn't convert it into c++ Here
Thanks