Hello I want to print the letter 'å' which is 131 in extended ascii and as far as I can see has UTF-8 code 00E5 and 0x00E5 in UTF-16. However, in the code below the program prints 'Õ' which is not what I wanted. I do not know what I have done wrong. Thanks in advance.
int main(void) {
wchar_t myChar = 0x00E5;
wprintf(L"%lc", myChar);
}
I'd try using an UTF-16 character literal and also set the locale (
setlocale) toCP_UTF_16LEif using MSVC or to the user-preferred locale if not.Tested in Windows 11 with VS2022