Le Nguyen The Dat bio photo

Le Nguyen The Dat

~ Data Science & Engineering

Twitter Facebook LinkedIn Github

Been trying to decode some Chinese datasets as a part of my work lately, I came accorss this problem. Normally everything works just fine on my Mac OS X 10.10.2:

$ luit -V
luit - 1.1.1
$ echo ä¯ÀÀÁ¿ | luit -encoding gbk -x -c
盲炉脌脌脕驴

But on my Ubuntu 14.04 system, it wasn’t that easy:

$ sudo apt-get install x11-utils #installing luit on Ubuntu
$ luit -V
luit - 1.1.1
$ echo ä¯ÀÀÁ¿ | luit -encoding gbk -x -c
Segmentation fault (core dumped) <--- what!?

Tried to search for a single working solution for a few days without any luck, so I did the necessity:

$ sudo apt-get install -y wget build-essential
$ wget http://invisible-island.net/datafiles/release/luit.tar.gz
$ tar -xvf luit.tar.gz
$ cd luit-20141204; ./configure; make; sudo make install

Apparently they fixed that in luit 2.0 - voilà:

$ luit -V
luit - 2.0-20141204
$ echo ä¯ÀÀÁ¿ | luit -encoding gbk -x -c
盲炉脌脌脕驴

Hopefully this will show up on Google search results whenever someone else encountered this error :).