]> git.ipfire.org Git - thirdparty/glibc.git/commit
Add generic C.UTF-8 locale (Bug 17318) codonell/c-utf8
authorCarlos O'Donell <carlos@redhat.com>
Thu, 29 Jul 2021 05:27:56 +0000 (01:27 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Thu, 29 Jul 2021 05:31:39 +0000 (01:31 -0400)
commitb2a77206b3c3bf4670acc069f6fdda76cf857d48
tree3e35b2a2b9c864a91a223c9bc94c35797af57aae
parent7de41f96a172e5f15bc449ec3c09dbd0ae4cf2c6
Add generic C.UTF-8 locale (Bug 17318)

We add a new C.UTF-8 locale.  This locale is not builtin to glibc, but
is provided as a distinct locale.  The locale provides full support
for UTF-8 and this includes full code point sorting via strcmp-based
collation.

The collation uses a new keyword 'strcmp_collation' which drops all
collation rules and generates an empty zero rules collation to enable
strcmp usage in collation. This ensures that we get full code point
sorting for C.UTF-8 with a minimal 92 bytes of overhead (LC_COLLATE
structure information).

The new locale is added to SUPPORTED.  Minimal test data for specific
code points (minus those not supported by collate-test) is provided
in C.UTF-8.in, and this verifies code point sorting is working
reasonably across the range.  The locale was tested manually with the
full set of code points without failure.

The locale is harmonized with locales already shipping in Gentoo,
Debian, Ubuntu, Fedora, CentOS Stream, and RHEL. A new tst-iconv9 test
is added which verifies the C.UTF-8 locale is generally usable.

Testing for fnmatch, regexec, and recomp is provided by extending
bug-regex1, bugregex19, bug-regex4, bug-regex6, transbug, tst-fnmatch,
tst-regcomp-truncated, and tst-regex to use C.UTF-8.

Tested on x86_64 or i686 without regression.
14 files changed:
iconv/Makefile
iconv/tst-iconv9.c [new file with mode: 0644]
localedata/C.UTF-8.in [new file with mode: 0644]
localedata/Makefile
localedata/SUPPORTED
localedata/locales/C [new file with mode: 0644]
posix/bug-regex1.c
posix/bug-regex19.c
posix/bug-regex4.c
posix/bug-regex6.c
posix/transbug.c
posix/tst-fnmatch.input
posix/tst-regcomp-truncated.c
posix/tst-regex.c