Can anyone explain why universal character literals (eg “\u00b1”) are being encoded into char strings as UTF-8? Why does the following print the plus/minus symbol?
#include <iostream>
#include <cstring>
int main()
{
std::cout << "\u00b1" << std::endl;
return 0;
}
Is this related to my current locale?
and
In short, the answer to your question is in your compiler documentation. However:
so you are guaranteed that the character you name is translated into an implementation defined encoding, possibly locale specific.