The code below prints the character for the pi number in VS2019, instead of the character ã
.
#include<iostream>
const char* p = "\u00E3"; // Character ã LATIN SMALL LETTER A WITH TILDE
int main() {
std::cout << p << '\n'; // This should compile by any compiler supporting some ASCII compatible encoding.
// It does compile in clang and GCC, printing `ã` in both. In VS2019 it prints the symbol for
// the pi number. However if I debug the code I can see the character `ã` in
// memory in the address given by `p`. What am I missing?
}
See demo in Coliru.
Edit
The question for which this is considered a duplicate doesn't use a universal-character-name as is the case in the above code. Therefore this should compile and execute correctly in VS2019.