Summary: | usr.bin/tr: ASCII collation passthrough doesn't work on Unicode-aware locales | ||
---|---|---|---|
Product: | Base System | Reporter: | O. Hartmann <ohartmann> |
Component: | bin | Assignee: | Baptiste Daroussin <bapt> |
Status: | Closed Works As Intended | ||
Severity: | Affects Many People | CC: | bapt, emaste, jbeich, marino, yuripv |
Priority: | --- | Keywords: | regression |
Version: | 11.0-STABLE | Flags: | jbeich:
maintainer-feedback+
|
Hardware: | Any | ||
OS: | Any |
Description
O. Hartmann
2015-11-09 10:41:37 UTC
See also Bug 204612. Try building with LC_COLLATE=C. Recent locales update in base r290494 may break a few ports e.g., https://lists.freebsd.org/pipermail/freebsd-ports/2015-November/101034.html Setting LC_COLLATE=C worked! Thank you very much. It also is applicable for Bug 204612. Same help. Same salvation. oh *** Bug 204612 has been marked as a duplicate of this bug. *** Cutting down configure I've found # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi which breaks tr(1) on a mixed locale (LANG unset) $ env -i LC_COLLATE=en_US.UTF-8 LC_CTYPE=C sh $ echo FooBar | tr A-Z a-z aq $ echo FooBar | tr '[:upper:]' '[:lower:]' foobar GNU tr (coreutils) works fine but doesn't support UTF-8 at all. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/tr.html says: c-c ... In locales other than the POSIX locale, this construct has unspecified behavior. So, while unfortunate, no one should rely on "c-c" constructs unless they explicitly set the POSIX("C") locale. As yuri stated, this is an unfortunate but expected problem |