Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6961125
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: BSD

2005-06-16 21:07:31

在完成中文系統建立的工作,您已經可以在您的 FreeBSD 機器上面顯示中文了。但如果您使用 Shell,您會發現, 您的 FreeBSD 只能顯示中文,卻無法接受中文的輸入工作。 如果您想要改進這個問題,您必須自己修改一些設定,使 FreeBSD 系統可以接受中文的輸出與輸入工作。

您必須要在您使用的 Shell 起始檔增加 locale 的設定。 (如果您的家目錄中並未有這樣的檔案,請自行建立)

Bash Shell:

~/.profile~/.bashrc 增加下面的內容:

#stty cs8 -istrip
#stty pass8
export LANG=zh_TW.Big5 #zh_CN
export LC_CTYPE=zh_TW.Big5 #zh_CN

另外在 ~/.inputrc 檔增加設定如下:

# inputrc - global inputrc for libreadline
# See readline(3readline) and `info rluserman' for more information.

# Be 8 bit clean.
set meta-flag on
set input-meta on
set output-meta on

# To allow the use of 8bit-characters like the german umlauts, comment out
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.
set convert-meta off

Tcsh Shell:

~/.login~/.cshrc 增加設定如下:

#stty cs8 -istrip
#stty pass8
setenv LANG zh_TW.Big5   #写成zh_CN
setenv LC_CTYPE zh_TW.Big5 #写成zh_CN
set dspmbyte="
0000000000000000000000000000000000000000000000000000000000000000
2222222222222222222222222222222222222222222222222222222222222220
2333333333333333333333333333333333333333333333333333333333333333
3333333333333333333333333333333333333333333333333333333333333330"

請將 dspmbyte 在 "" 中的字串接起來。

關於 dspmtype 設定的原因是因為在 tcsh 的 man page 中,對照 Big5 的使用字碼表 [x81-xFE][x40-x7Ex80-xFE] 而設定的。

tcsh-6.11 內建了中文 big5 支援

       dspmbyte (+)
If set to `euc', it enables display and editing
EUC-kanji(Japanese) code. If set to `sjis', it
enables display and editing Shift-JIS(Japanese)
code. If set to `big5', it enables display and
editing Big5(Chinese) code. If set to the follow
ing format, it enables display and editing of
original multi-byte code format:

所以以後 dspmbyte 設定成 big5,不用設定一大串; 或者乾脆不要設定 dspmbyte,只要 LANG 為 zh_TW.Big5 就可以了 :)

2001/09/05 -CURRENT 匯入 tcsh-6.11
2001/10/08 -STABLE 匯入 tcsh-6.11

如果是簡體環境,由於 csh/tcsh 並沒有包含自動偵測簡體環境的部分, 可以參考 big5 的做法修改 tc.const.c, 或是設定 set dspmbyte=euc 就可以了。

Figure 7-10. tcsh snapshot

阅读(2416) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~