Vlad Skvortsov's Blog

cyrillic ditrack gtd guitar mac music pdf phd postscript productivity programming projects python r russian shell terminal tex tips utf-8 wadcomblog

My name is Vlad Skvortsov, I'm a software engineer: it's my job, hobby and addiction.

My primary interests include high-performance, scalable, fault-tolerant distributed systems; server-side applications; information retrieval technologies; procedural aspects of software engineering process.

I work on several private and open-source projects, hacking in Python, Haskell, Erlang, Perl and C.

Guitar, hiking, ice hockey and other hobbies help me to balance my life.

My e-mail is vss@73rus.com.

Switching iTerm To UTF-8

Oct 30 2009, 18:12 permalink

This is just a short note on how I (finally) migrated to UTF-8 in my terminal (iTerm 0.10) on MacOS X 10.4.

It was really very simple. First of all, here is how the locale/language variables are set up in my .profile:

export LANG=ru_RU.UTF-8

if [ "$ENCODING" = "koi8r" ]; then
        export LANG=ru_RU.KOI8-R

export LC_ALL=$LANG

The koi8r is still there just in case. I have a "bookmark" in iTerm (Bookmarks -> Manage Bookmarks), which calls login like this:

env ENCODING=koi8r login -fp vss

This way I don't need to mess around if I ever need to switch back to koi8-r encoding temporarily.

I had to spend a few minutes to figure out why Vim 7.2 doesn't work with UTF-8 characters. It was installed from sources (directly with "make && sudo make install"), and apparently multibyte support is not there by default.

To fix that, I just had to pass appropriate options to configure:

$ cd ~/vim72/src
$ ./configure --with-features=big --enable-multibyte

Finally, to make my mutt 1.5.19 happy, I had to remove "charset" option from the configuration file.

That's about it!