Can somebody please tell me what would be the Unicode equivalent for "(char)"?
For ASCII I always used for example
(char)(7)
Now I want to do the same but for Unicode.
But
(wchar_t)(7)
did not work out, and wchar does not exist.
I want to pass this (possible) Unicode character to a function that accepts a wstring.
Or in other words: How can I programmatically create a wstring from a unicode character value (like 7 for TAB)?
char
must be able to store an 8-bit UTF-8 code unit; there's also char16_t and char32_t (with at least 16 and 32 bit respectively). Note a single glyph can be represented by multiple UTF-8/-16 code units, therefore there's no exact equivalent to achar
interpreted as an ASCII character. – dyp