How do I (unconditionally) enable unicode support in busybox?

Harald Becker ralda at gmx.de
Thu Aug 7 12:03:24 UTC 2014


Hi James !

> Therefore I will follow this up tomorrow with another email that
> gives simple instructions and a little script for creating a busybox
> chroot environment where "export LANG=..." fails to work as
> expected on my machine.

Looking forward to see this ...

> and it did not fix the problem.  Did I miss the boat by not exec'ing
> /bin/sh explicitly and only through calling the script?  I don't think
> so because this does not work either:
>
> if [ "$LANG" != utf ]; then
>      export LANG=utf
>      exec /bin/sh $0 "$@"
> fi

I'm not sure if LANG=utf is enough to enable full UTF support. Look at 
the correct syntax: LANG=en_US.UTF-8

... and still this does not only depend on Busybox. Which lib is your BB 
linked to, is it linked statical or dynamical. Does your lib provide 
locale management? Does your lib need accessible extra locale files to 
behave correct (like glibc). We need the full picture to see what's 
going on. I assume you are looking for a Busybox problem which is indeed 
an environmental setup problem.

> The follow doesn't work either:
>
>      export LANG=utf
>      init2

You mean exec init2, else init2 will not run as process 1?

> I did set it at the beginning of both scripts with an export and it
> did not work.  I tried exactly the code above and it does not work.
> I keep saying:
>
>      export LANG=...
>
> DOES NOT WORK for changing the unicode behavior.  It seems to be set
> once and for all by the value passed in by the user via the bootloader.

This looks more and more like a setup problem of your system. Either 
there is a very new (yet undetected bug) in Busybox or it fails due to 
some other reason. This all worked by so many people on so many systems 
for years, couldn't be no one else detected this problem yet.

> and copied into a tmpfs at /.  After that, control is passed by the
> bootloader (or kernel?) to the /init script that was stored in the
> archive. This is my script.

That's exactly the way I'm doing it for years on several systems, 
without any trouble to activate whatever I like.

> If there is any more information I can provide that will possibly
> be of help, I'd be glad to give it to you.

Yes (see above), which lib is your BB linked? static or dynamic? Does 
your lib provide locale support? Sorry, if you already gave this 
information, I did not follow the thread from the whole beginning. Dig 
into it somewhere on the fly and don't saved the old messages.

> Busybox is absolutely fantastic software.  It is so good it is almost
> magical.  I will do what I can to help with this problem because this
> is a small way I can help give back.  If the problem is on my end I
> don't know what else I can change except the .config but I'm willing
> to try anything you might suggest.  If you don't want to pursue this
> further, that is okay with me too because I have my stuff working now
> with my tr hack.

James, I see your confusion and trouble. It's just magical it does not 
behave as you describe, as BB ash shall work like this and did it 
already for so many other people. There has to be some other kind of 
problem. We really need a way to reproduce your problem, before anyone 
may be able to dig into code and see what is the reason for your trouble.

--
Harald



More information about the busybox mailing list