Configuring irssi with UTF-8 and spell checking

I'm switching to using IRC with irssi running in a screen instance on my virtual server. The advantage over running xchat or similar on the desktop is that one can connect from anywhere and disconnect in between without loosing the backlog.

With scripts for irssi it's possible to get most of the comforts of a GUI client, such as nick coloring (nickcolor.pl) and spell checking (spellcheck.pl).

I had some problems getting nordic characters to work, but the solution was to switch everything to utf-8:

  • The terminal
    • In gnome terminal menu, Terminal->Set character encoding->UTF-8
  • The remote environment
    • Add export LANG en_GB.UTF-8 to the end of ~/.bashrc
  • The screen session when starting irssi
    • screen -SU irc irssi (creates a screen instance named 'irc' using UTF-8 that runs irssi)
  • In irssi
    • /set term_type utf-8
So not really out-of-the-box as in some GUI clients, but hopefully a bit easier to google now.

The spellcheck.pl script didn't work with UTF-8 out of the box either, aspell needs the --encoding=UTF-8 parameter passed to it to work with non-english characters.

To install spellcheck.pl for irssi with utf support:

  • Log in to the machine you run irssi on
  • Install aspell:
    • sudo apt-get install aspell libtext-aspell-perl aspell-en aspell-de aspell-fi # and so on for the languages that you want spell check dictionaries installed for
  • cd ~/.irssi/scripts # if the scripts directory doesn't exists, create it
  • wget http://scripts.irssi.org/scripts/spellcheck.pl #downloads the original spellcheck.pl
  • Edit spellcheck.pl and find the line
        $speller{$_[0]}->set_option('sug-mode', 'fast') or return undef;
  • Add a new line after it and save:
        $speller{$_[0]}->set_option('encoding', 'utf-8') or return undef;
  • In irssi, write /script load spellcheck.pl
  • You can specify what language spellchecking should be used in different channels by typing /set spellcheck_languages NetworkName/#channelName/TwoLetterLanguageCode in irssi. Default seems to be english.

Update:

Aspeller seems to be a bit more user friendly spellchecker, as it doesn't spam the window with spelling suggestions, just highlights the misspelled words. Unfortunately it doesn't allow specifying channel specific languages. There's also spell.pl.

1 comments :: Configuring irssi with UTF-8 and spell checking

  1. We would presume of which anyone with visitors by now features Spellcheck, truth check, grammar check, along with proper thoughts and opinions check in any case, and so getting that as part of anything over and above the e-mail program can be redundant.
    If you interested this comment please share your friend. Thanks for read this comment.