- 论坛徽章:
- 0
|
最近把系统换成了Debian系统,中文使用utf8编码,但由于之前是在WINDOWS上工作,加上之前有些脚本程序在BSD上编写,中文注释用的全是GB2312的编码,这下郁闷了,乱码。。。本来是装了mrxvt,使用GB2312看倒也是可以,但由于自己习惯了xfce自带的Terminal,所以还是觉得用些不习惯,后来在terminal的HELP里看到这段:
Terminal itself does not (yet) include builtin support for switching encodings on the fly in a terminal session. But since Terminal implements an UTF-8 mode, you can use the Luit application to switch between different character encodings within a terminal session.
就去看了一下luit的man手册,
Luit is a filter that can be run between an arbitrary application and a
UTF-8 terminal emulator. It will convert application output from the
locale’s encoding into UTF-8, and convert terminal input from UTF-8
into the locale’s encoding.
An application may also request switching to a different output encod‐\
ing using ISO 2022 and ISO 6429 escape sequences. Use of this feature
is discouraged: multilingual applications should be modified to
directly generate UTF-8 instead.
Luit is usually invoked transparently by the terminal emulator. For
information about running luit from the command line, see EXAMPLES
below.
EXAMPLES
The most typical use of luit is to adapt an instance of XTerm to the
locale’s encoding. Current versions of XTerm invoke luit automatically
when it is needed. If you are using an older release of XTerm, or a
different terminal emulator, you may invoke luit manually:
$ xterm -u8 -e luit
If you are running in a UTF-8 locale but need to access a remote
machine that doesn’t support UTF-8, luit can adapt the remote output to
your terminal:
$ LC_ALL=fr_FR luit ssh legacy-machine
上面内容大概截取了我用到的那部份,具体当然是看man了
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/52698/showart_444762.html |
|