Unicode issues with ash

Seb sbb at tuxfamily.org
Tue Mar 22 17:30:18 UTC 2011


Hello,


Trying to use busybox (1.18.4) as a daily ash shell (config attached),
I encounter some problems with my UTF-8 locale. These appear only when
you open a login ash session (no problem when this one is opened from
a bash session), that's why I created a temporary user to reproduce
the bug:

 # useradd unibug -s /bin/ash -d /tmp  -p ""
 # echo "export LANG=fr_FR.utf8  PS1=prompt:\ " >/tmp/.profile
 # export LANG=fr_FR.utf8
 # xterm -fa DejaVuSansMono:size=10:Bold -exec su - unibug
 prompt: x="é"       # "é" turns on "?" if the cursor is moved back.
 prompt: echo ${#x}
  2
 prompt: éééé        # press [del] as far as you can...
 prom                # ... and eat the prompt.

It seems the shell ignores the locale and considers a byte-oriented
charset is used in input, so each wide character is acknowledged to
be several (no problem if you redo the test using "fr_FR" as locale).

I've first tryed to use the libc Unicode routines
(CONFIG_UNICODE_USING_LOCAL option, with glibc-2.11.1 on Slackware
13.1), and got a worse result, as I couldn't even enter an accented
character (but ASCII worked well).

Then I've finally disabled the LANG checking
(CONFIG_FEATURE_CHECK_UNICODE_IN_ENV option), which seems to fix the
problem for me (but will certainly mess on a non-Unicode system). So,
the problem appears to be in the way busybox interacts with the LANG
environment variable.

Regards, expecting this to be useful for you,
Seb.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.gz
Type: application/octet-stream
Size: 5666 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20110322/36972453/attachment.obj>


More information about the busybox mailing list