[libcxx-commits] [PATCH] D119441: [libc++] Fix locale name construction

Hubert Tong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 13 22:24:47 PST 2022


hubert.reinterpretcast added inline comments.


================
Comment at: libcxx/src/locale.cpp:569
+  // Find out user preferred locale
+  if (one == "")
+    one = setlocale(LC_ALL, "");
----------------
It is insufficient to only do this for `""`.
On Linux, the environment is queried for each category that is specified with an empty string in the expanded `LC_ALL` format, e.g. (https://godbolt.org/z/cvYMcMbx4):
```
  setlocale(LC_ALL, "LC_CTYPE=;LC_NUMERIC=;LC_TIME=;LC_COLLATE=en_US.UTF-8;LC_MONETARY=;LC_MESSAGES=;LC_PAPER=;LC_NAME=;LC_ADDRESS=;LC_TELEPHONE=;LC_MEASUREMENT=;LC_IDENTIFICATION=");
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119441/new/

https://reviews.llvm.org/D119441



More information about the libcxx-commits mailing list