chillerdragon@ChillersMacBookPro cplay % cat robster.c /* File: robster.c */ #include #include using namespace std; int main() { cout << "With unset locale:" << endl; cout << " setlocale(LC_ALL, NULL): " << setlocale(LC_ALL, NULL) << endl; cout << " std::locale(\"\").name(): " << std::locale("").name() << endl; cout << "With setlocale(LC_ALL, \"\"):" << endl; setlocale(LC_ALL, ""); cout << " setlocale(LC_ALL, NULL): " << setlocale(LC_ALL, NULL) << endl; cout << " std::locale(\"\").name(): " << std::locale("").name() << endl; return 0; } chillerdragon@ChillersMacBookPro cplay % g++ robster.c clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated] chillerdragon@ChillersMacBookPro cplay % ./a.out With unset locale: setlocale(LC_ALL, NULL): C std::locale("").name(): With setlocale(LC_ALL, ""): setlocale(LC_ALL, NULL): en_US.UTF-8 std::locale("").name(): chillerdragon@ChillersMacBookPro cplay % locale LANG="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_ALL="en_US.UTF-8" chillerdragon@ChillersMacBookPro cplay % uname -a Darwin ChillersMacBookPro.fritz.box 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 x86_64 chillerdragon@ChillersMacBookPro cplay %