On Sun, Apr 17, 2011 at 1:56 AM, Stefan Sperling <s...@openbsd.org> wrote: > On Tue, Apr 05, 2011 at 12:25:37AM +0200, Stefan Sperling wrote: >> For isprint() to work correctly in a UTF-8 locale applications must >> set up the LC_CTYPE locale before using isprint(). >> >> As done for hexdump and tcpdump already. >> >> This diff covers all offenders in usr.bin. > > Todd Miller suggested using LC_ALL instead of LC_CTYPE so we don't have > to revisit these when we add support for more categories.
Has there been any sort of audit of how this will affect scripts distributed with the system? I seem to recall having to fix various scripts elsewhere when Redhat started shipping with LANG=en_US.UTF-8 set in the default shell environment, things like character ranges in grep patterns changing behavior. The scripts didn't handle any sort of non-C locale correctly; the change in default just made that incredibly obvious. The quick fix is to apply the hammer and pass LC_ALL=C, but that's overkill when all you really want is to force LC_CTYPE=C behavior. Hmm... export LC_CTYPE=C [[ -n $LC_ALL ]] && export LC_COLLATE=$LC_ALL LC_TIME=$LC_ALL \ LC_NUMERIC=$LC_ALL LC_MONETARY=$LC_ALL LC_MESSAGES=$LC_ALL A quick grep of /etc/*/* on a Redhat box finds *lots* of LANG=C settings on commands. Wheee.... Philip Guenther