Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot type unicode in a ubuntu:14.04 container, can type just fine in busybox

Tags:

docker

I cannot type unicode characters into an ubuntu:14.04 container, but can do just fine in a busybox container, which is really a surprise because busybox is just 2.4 MB while ubuntu:14.04 is 200+ MB. What is the reason?

like image 913
Phương Nguyễn Avatar asked Sep 03 '14 06:09

Phương Nguyễn


People also ask

How do I type Unicode characters in Ubuntu?

To enter a character by its code point, press Ctrl + Shift + U , then type the four-character code and press Space or Enter .

What does BusyBox container do?

What's BusyBox? Dubbed the “Swiss Army Knife of Embedded Linux,” BusyBox packages together multiple, common UNIX utilities (or applets) into one executable binary. It helps you create your own Linux distribution, and our associated container image helps you deploy it across different devices.

How do I run BusyBox shell?

You can set BusyBox as your shell using the chsh --shell command, followed by the path to the BusyBox sh application. I keep BusyBox in /lib64 , but its location depends on where your distribution installed it.


1 Answers

I opened an issue and it turned out that the solution is pretty simple. One needs to run the container with the option:

-e LANG=C.UTF-8

I have tested with other UTF-8 variants (such as en_US.UTF-8 and el_GR.UTF-8) but they don't seem to work.

Setting the LANG environment variable in the Dockerfile seems to work as well. Just add the line:

ENV LANG C.UTF-8

I'm still not sure however what's so special about C.UTF-8 over the other UTF-8 variants...

like image 188
Asotos Avatar answered Sep 20 '22 23:09

Asotos