A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1220 ====================================================================== Reported By: bhaible Assigned To: ====================================================================== Project: 1003.1(2016/18)/Issue7+TC2 Issue ID: 1220 Category: System Interfaces Type: Omission Severity: Editorial Priority: normal Status: New Name: Bruno Haible Organization: GNU User Reference: Section: --- Page Number: --- Line Number: --- Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2018-12-20 13:46 UTC Last Modified: 2020-10-29 18:25 UTC ====================================================================== Summary: Add an API to query the name of a locale category of a locale object ======================================================================
---------------------------------------------------------------------- (0005085) shware_systems (reporter) - 2020-10-29 18:25 https://austingroupbugs.net/view.php?id=1220#c5085 ---------------------------------------------------------------------- Environment variables are reliable only when it is known putenv() or setenv() hasn't modified the value. 3rd party libraries cannot make this assumption. If an application calls setlocale(LC_ALL, all_locale), getlocalename_l(LC_ALL, LC_GLOBAL_LOCALE) will be expected to return the value of all_locale, not multiple values. Without such a call, the application requirement that they start with the effect of setlocale(LC_ALL, "POSIX") means that gets returned, again a single value. Returning every name would be the province of a separate interface that returns a char** value, nominally, not char*, to avoid having to parse the return like is required with setlocale(). A savobj=duplocale(oldobj) and newlocale(,,oldobj);oldobj=savobj; simply use the current values, which is frequently desirable, but doesn't guarantee this is the LC_ALL value that is relevant if newlocale(LC_ALL_MASK, all_locale, 0) was what created oldobj to begin with. A library can't assume oldobj=newlocale(e.g. LC_CTYPE_MASK,value, oldobj) hasn't been called before it sees it or duplocale() was called. So no, it can NOT be done reliably using just the existing interfaces. Issue History Date Modified Username Field Change ====================================================================== 2018-12-20 13:46 bhaible New Issue 2018-12-20 13:46 bhaible Name => Bruno Haible 2018-12-20 13:46 bhaible Organization => GNU 2018-12-20 13:46 bhaible Section => --- 2018-12-20 13:46 bhaible Page Number => --- 2018-12-20 13:46 bhaible Line Number => --- 2020-10-05 11:11 geoffclare Note Added: 0005026 2020-10-05 11:13 geoffclare Note Edited: 0005026 2020-10-05 11:13 geoffclare Note Edited: 0005026 2020-10-05 15:45 bhaible Note Added: 0005027 2020-10-05 17:57 shware_systems Note Added: 0005030 2020-10-05 17:58 shware_systems Note Edited: 0005030 2020-10-07 13:29 geoffclare Note Added: 0005035 2020-10-07 15:08 shware_systems Note Added: 0005037 2020-10-23 14:21 geoffclare Note Added: 0005059 2020-10-23 15:57 shware_systems Note Added: 0005062 2020-10-26 10:03 geoffclare Note Added: 0005063 2020-10-26 14:50 shware_systems Note Added: 0005065 2020-10-26 16:16 geoffclare Note Added: 0005067 2020-10-29 18:25 shware_systems Note Added: 0005085 ======================================================================