Using UTF-8 in UNIX-terminals and programs
If you want to use UTF-8 in your terminal emulator, it has to support UTF-8 and a system with UTF-8-locales installed. Locales are definitions for date, language, timezone settings, currency and most user defined parameters. Most GNU/Linux-distributions have UTF-8-locales installed.
When logging onto servers like login.stud.ntnu.no with UTF-8 you have to configure your terminalemulator first. In PuTTY you have to go to the Translation under the Category-part and choose UTF-8 in the list Character sets translation on received data. uxterm and urxvt use UTF-8 as default, and in Gnome Terminal you might have to change the settings in the menu Terminal-Choose character set-UTF-8.
You have to tell the system you want to use UTF-8-locales after you've logged in. You can check to see what locale you're using with locale
gaupe:~$ locale LANG=en_US LC_CTYPE=nb_NO LC_NUMERIC=nb_NO LC_TIME=nb_NO LC_COLLATE="en_US" LC_MONETARY="en_US" LC_MESSAGES="en_US" LC_PAPER="en_US" LC_NAME="en_US" LC_ADDRESS="en_US" LC_TELEPHONE="en_US" LC_MEASUREMENT="en_US" LC_IDENTIFICATION="en_US" LC_ALL=
To change the locales, you use the command export. You will want to change LANG and LC_ALL on gaupe like this:
gaupe:~$ export LANG=en_DK.UTF-8 gaupe:~$ export LC_ALL=en_DK.UTF-8 gaupe:~$ locale LANG=en_DK.UTF-8 LC_CTYPE="en_DK.UTF-8" LC_NUMERIC="en_DK.UTF-8" LC_TIME="en_DK.UTF-8" LC_COLLATE="en_DK.UTF-8" LC_MONETARY="en_DK.UTF-8" LC_MESSAGES="en_DK.UTF-8" LC_PAPER="en_DK.UTF-8" LC_NAME="en_DK.UTF-8" LC_ADDRESS="en_DK.UTF-8" LC_TELEPHONE="en_DK.UTF-8" LC_MEASUREMENT="en_DK.UTF-8" LC_IDENTIFICATION="en_DK.UTF-8" LC_ALL=en_DK.UTF-8
vim and UTF-8
vim uses UTF-8 internally, and converts between character sets when reading and writing files. You can instruct vim to use UTF-8 by default (unless it detects otherwise) by putting the following in your .vimrc:
set fileencoding=utf-8 set encoding=utf-8 set termencoding=utf-8
UTF-8 and emacs
Emacs on login.stud.ntnu.no supports UFT-8. If your version doesn't, you probably have to install mule (sudo aptitude install mule-ucs) and add the following to your .emacs (or .xemacs/custom.el):
(prefer-coding-system 'mule-utf-8) (setq locale-coding-system 'mule-utf-8) (set-terminal-coding-system 'mule-utf-8) (set-keyboard-coding-system 'mule-utf-8) (set-selection-coding-system 'mule-utf-8)
Using UTF-8 with irssi
If you want to use UTF-8 with irssi, you type the following into your terminal:
/set term_charset UTF-8
/set recode_out_default_charset UTF-8
/recode add UTF-8
/help recode
mutt and UTF-8
If you use mutt for e-mail, you can configure the .muttrc-file to use UTF-8:
set charset=utf-8 set send_charset=utf-8
au BufNewFile,BufRead mutt* set tw=77 ai nocindent fileencoding=utf-8
UTF-8 and pine
The e-mail client pine does not support UTF-8.
It is possible, if you really want to, to use UTF-8 in pine. You have to use a program that translates everything going in and out so that pine still thinks its UTF-8-less:
user@gaupe:~$ luit -encoding 'ISO-8859-1' pine
| Språk: | Kommentarer: | 0 | Aid: | 548 | Brukervurdering: |
|
|
| Sist oppdatert: | 2007-08-01 | Forfatter: | livermor | Lest: | 372 ganger |