Rubénerd :)

Tuesday 09th February 2010

nano 2.2.2 having issues with UTF-8

Icon from the Tango Desktop Project

Running the ./configure script from the latest nano tarball on a virgin Snow Leopard machine (my dad’s) I keep running into a problem with UTF-8 support.

Using ncurses as the curses library
checking for use_default_colors in -lncurses… yes
configure: error:

UTF-8 support was requested, but insufficient UTF-8 support was detected in your curses and/or C libraries. Please verify that your slang was built with UTF-8 support or your curses was built with wide character support, and that your C library was built with wide character support.

I’ve built the latest ncurses and slang libraries from MacPorts and have confirmed they were built with UTF-8 support. Only thing I can think of is it’s using the outdated ncurses from the system instead of MacPorts, but other ports such as Midnight Commander are using it. Will keep digging.

For what it’s worth, it builds just fine without UTF-8, but it’s a feature I’d rather have.

Monday 30th July 2007

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

Dedicated to my groovy late mum Debra Schade.