Dedicated to my late brave, beautiful and silly mummy, Debra Ross. I love you mumster.

Skip navigation

You're either viewing an archived story, or an archived story. To view the latest posts, fling yourself over to the home page, or you can view the complete post index.
Whatever you do, don't go here.

Enabling UTF8 in Nano

nanoutf8.png

Everyone knows that vi and vim are better than emacs right? Well personally I prefer nano even over vi. It was the first text editor I ever learned (okay it was actually pico, the editor it was cloned from) on UNIX and even now I use it for almost everything: Ruby, Perl, HTML, XML, KitchenSink… even these weblog posts. It’s a small world, so why not use a small editor? Hey, that’s catchy.

The problem though if you install Nano from MacPorts is that it’s not enabled with a number of what I would consider critical features. Aside from syntax highlighting support probably the most noticeable of which is the lack of UTF-8 support which means it spits out a series of question marks whenever you’re editing files with katakana, kanji and kitchen-sink in it for example. Bummer.

A cursory glance over at the DarwinPorts website shows that in fact it’s possible to enable UTF-8:

Variant: utf8 {
configure.args-append –enable-utf8
configure.args-delete –disable-utf8
depends_lib-append port:ncursesw
depends_lib-delete port:ncurses
}

The key is simply to add +utf8 when you initially build the port, along with any other conditions you think are spiffy:

sudo port -v install nano +utf8 +color +no_wrap

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*