#18345 closed bug (fixed)
duplocale does not work on a mixed locale
Reported by: | bhaible | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | System/POSIX | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Using duplocale and then uselocale does not produce the expected results, when the locale was constructed by several setlocale calls, each affecting different categories, and duplocale is used with argument LC_GLOBAL_LOCALE. This should be supported, since POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/functions/duplocale.html> says: "If the locobj argument is LC_GLOBAL_LOCALE, duplocale() shall create a new locale object containing a copy of the global locale determined by the setlocale() function."
The test case is attached. It is known to work fine on glibc, FreeBSD, OpenBSD, Solaris 11.4, Cygwin 2.9.0. On Haiku:
$ gcc -ggdb -Wall test-duplocale.c $ ./a.out monetary value: Expected: $123.75 Actual: 123.75 numeric value: Expected: 3,5 Actual: 3.5 time value: Expected: janvier Actual: January
Attachments (1)
Change History (4)
by , 21 months ago
Attachment: | test-duplocale.c added |
---|
follow-up: 3 comment:2 by , 20 months ago
Milestone: | Unscheduled → R1/beta5 |
---|
Should this fix be backported to the r1beta4 branch as well?
test case