Hi!

----

Below is a testcase which shows a problem with the handing code for
LC_*/LANG variables.
AFAIK the problem looks like this:
If I set LANG to a value, then set any of the LC_* variables to
(partially) override LANG and then unset (or set it to '' (empty
string)) the LC_* variable |setlocale()| is not being called to restore
the locale settings defined via the LANG variable.

The testcase looks like this:
-- snip --
export LC_ALL=en_US.UTF-8
printf "\u[20ac]\u[20ac]" >two_euro_chars.txt

unset \
        LC_COLLATE \
        LC_CTYPE \
        LC_MESSAGES \
        LC_MONETARY \
        LC_NUMERIC \
        LANG

(
cat <<EOF

export LANG=en_US.UTF-8 LC_ALL=C
wc -C < two_euro_chars.txt
unset LC_ALL
wc -C < two_euro_chars.txt
export LC_ALL=C
wc -C < two_euro_chars.txt

EOF
) | x="$(/usr/bin/ksh93)"

[[ "$x" == ~(E)[[:space:]]*6[[:space:]]*2[[:space:]]*6 ]] || \
        printf "expected \$'       6\\\n       2\\\n       6', got %q\n" "$x"
-- snip --

AFAIK the output should be "6 2 6" but for ast-ksh.2009-09-08 the
testcase above prints "6 6 6" ...

This happens for any of the LC_* variables overriding LANG and LC_ALL
overriding both the other LC_* variables and LANG...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to