A NOTE has been added to this issue. ====================================================================== http://austingroupbugs.net/view.php?id=1122 ====================================================================== Reported By: joerg Assigned To: ====================================================================== Project: 1003.1(2016)/Issue7+TC2 Issue ID: 1122 Category: System Interfaces Type: Enhancement Request Severity: Editorial Priority: normal Status: New Name: Jörg Schilling Organization: User Reference: Section: 3 + 4 Page Number: 1102...and others Line Number: somewhere in section 3 and 4 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2017-02-28 16:51 UTC Last Modified: 2018-08-09 21:39 UTC ====================================================================== Summary: POSIX should include gettext() and friends ======================================================================
---------------------------------------------------------------------- (0004080) bhaible (reporter) - 2018-08-09 21:39 http://austingroupbugs.net/view.php?id=1122#c4080 ---------------------------------------------------------------------- Should the gettext() function family be added to POSIX, in the current state? As a former GNU gettext maintainer, I believe: NO. 1) Applications which need the API and tools can simply install the GNU gettext package. This works even on platforms which have the API already implemented by the system, namely Solaris and NetBSD. There are some small integration issues between the system libc and the GNU libintl, but they are small enough to not cause trouble in real applications. 2) Like EdSchouten says (0003603), there are already too many APIs in POSIX that depend on global state. While gettext() can be implemented in a multithread-safe way, by use of locks, it still costs CPU cycles to do so. (Recently I stumbled across a program that was spending 29% of its time fetching the current locale and computing a property of it - simply because there is no way for a program to attach information to a locale_t object.) So, a gettext_l function would be necessary. 3) Web servers and application servers want to do translations based on user preferences, and the administrators of such servers don't want to install all possible locales of the world. But when you don't have the locale data for locale ll_CC installed, a newlocale(LC_MESSAGES,"ll_CC",NULL) call will fail, thus you can't use gettext() or gettext_l() for that locale. 4) Each time ISO C or POSIX has standardized something regarding internationalization, the result was moderately or highly unusable 10 to 20 years later. wchar_t strings, from the ISO C Amendment (1995), are ill-designed as described in https://www.gnu.org/software/libunistring/manual/html_node/The-wchar_005ft-mess.html#The-wchar_005ft-mess . locale_t is ill-designed because it is not extensible. The POSIX locale specifies character classes, but no system I know of makes the Unicode properties of characters accessible through the wctype() and iswctype() functions. Probably the reason is that the standardization committees didn't (and couldn't) foresee the developments that took place in the next 20 years, but the standard couldn't evolve since it's a standard. Issue History Date Modified Username Field Change ====================================================================== 2017-02-28 16:51 joerg New Issue 2017-02-28 16:51 joerg Name => Jörg Schilling 2017-02-28 16:51 joerg Section => 3 + 4 2017-02-28 16:51 joerg Page Number => 1102...and others 2017-02-28 16:51 joerg Line Number => somewhere in section 3 and 4 2017-03-01 16:05 steffen Note Added: 0003575 2017-03-01 16:54 shware_systems Note Added: 0003576 2017-03-01 17:10 joerg Note Added: 0003577 2017-03-01 17:10 joerg Note Edited: 0003577 2017-03-01 17:11 steffen Note Added: 0003578 2017-03-01 17:13 steffen Note Added: 0003579 2017-03-01 17:23 joerg Note Added: 0003580 2017-03-01 17:27 joerg Note Edited: 0003580 2017-03-01 18:09 joerg Note Edited: 0003580 2017-03-01 22:37 steffen Note Added: 0003581 2017-03-02 06:39 shware_systems Note Added: 0003582 2017-03-02 09:09 joerg Note Added: 0003583 2017-03-02 09:40 keld Note Added: 0003584 2017-03-02 09:56 keld Note Added: 0003585 2017-03-02 14:41 steffen Note Added: 0003586 2017-03-02 17:01 keld Note Added: 0003587 2017-03-03 04:42 shware_systems Note Added: 0003588 2017-03-03 16:44 joerg Note Added: 0003596 2017-03-03 21:21 EdSchouten Note Added: 0003603 2017-03-05 00:12 keld Note Added: 0003608 2017-03-05 00:13 keld Note Edited: 0003608 2017-03-05 00:14 keld Note Edited: 0003608 2017-03-05 00:17 keld Note Edited: 0003587 2017-03-06 10:28 joerg Note Added: 0003609 2017-03-06 10:28 joerg Note Edited: 0003609 2017-03-06 10:33 joerg Note Added: 0003610 2017-03-06 10:33 joerg Note Edited: 0003610 2017-04-05 05:49 shware_systems Note Added: 0003659 2018-08-09 16:06 eblake Note Added: 0004076 2018-08-09 21:35 bhaible Note Added: 0004079 2018-08-09 21:39 bhaible Note Added: 0004080 ======================================================================