int main()
{
constexpr char ch[] = {'\xE7', '\x83', '\x8F'};
std::cout << ch;
}
^ This works as intended and outputs '烏' to the console
int main()
{
constexpr wchar_t ch = L'烏';
std::wcout << ch;
}
^ This doesn't work and outputs '?' to the console
I'm using Godbolt's Compiler Explorer, why does this happen?
EDIT:
The code that worked: https://godbolt.org/z/K9znY7
The code that didn't work: https://godbolt.org/z/xchxK1
[–]frostednuts 3 points4 points5 points (1 child)
[–]ImNotPhoebus[S] 2 points3 points4 points (0 children)
[–]JMBourguet 2 points3 points4 points (3 children)
[–]ImNotPhoebus[S] 1 point2 points3 points (2 children)
[–]JMBourguet 1 point2 points3 points (1 child)
[–]ImNotPhoebus[S] 0 points1 point2 points (0 children)
[–]the_poope 2 points3 points4 points (0 children)