Vincent Lefevre dixit:

>I think that it should enable this option in posix and sh modes.

No, because POSIX specifies some amount of locales tracking,
using the host’s wide char functions, locales, etc. which
is diametrally against what mksh promises (to behave consistently
across platforms).

There is no support in mksh for POSIX locales, nor for any
charsets other than UTF-8. This is by design.

Note that XBD 8.2 only specifies the "POSIX" and "C" locales,
and that support for GNU-style language[_territory][.codeset]
locales is XSI-optional. For the purpose of POSIX, mksh is an
operating environment with 32-bit integers and support for only
the C (= POSIX) locale.

|   If the locale value is not recognized by the implementation, the
|   behavior is unspecified.

This is sorta like LC_ALL=foo but foo not enabled in the locales
Debian package, nor locales-all installed. For the purpose of
POSIX, everything except the C/POSIX locale is POSIXly unspecified
in mksh, although we do enable the UTF-8 mode in Debian for an
*interactive* shell when the environment variables are set
accordingly. (Admittedly, this means we should probably track the
locale-related variables and imply set +U when LC_ALL=C is set…
I’ll put that on my TODO, though low-priority.)

>The following is even more unexpected:
>
>$ lksh -o sh -c 'a=$(/usr/bin/printf \\u00e9); echo $a ${#a}'

lksh is specifically for legacy scripts, which makes this even
worse. Especially in the ksh world, most scripts assume LC_ALL=C
but don’t even explicitly set that. Having shell operations
suddenly using UTF-8 would break them.

bye,
//mirabilos
-- 
<igli> exceptions: a truly awful implementation of quite a nice idea.
<igli> just about the worst way you could do something like that, afaic.
<igli> it's like anti-design.  <mirabilos> that too… may I quote you on that?
<igli> sure, tho i doubt anyone will listen ;)


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to