Debian Chinese How-To
This is my personal experience with chinese environment setup on my Debian Box, with KDE desktop. Here’s my specs.
- Debian Unstable, kernel 2.6.18-1-686
- xserver-xorg 7.1.0-4
- kde 3.5.5
Setting your system with english locales, so that your desktop, menus and programs’ file menus won’t show english characters in blurry chinese ttf fonts. You will still have the ability to input chinese in almost everything(browsers, konquerer, instant messengers, konsole, xchat and more).
Here’s a step by step instruction.
- Setting UTF-8 Locale system wide
Codes:
dpkg-reconfigure locales
This command will prompt you a screen to select your desired locales. For my case, I’ve selected
- en_US ISO-8859-1
- en_US.UTF-8 UTF-8
- zh_CN GB2312
- zh_CN.GB18030 GB18030
- zh_CN.GB18030 GB18030
- zh_CN.GB18030 GB18030
- zh_TW BIG5
- zh_TW.UTF-8 UTF-8
Set en_US.UTF-8 UTF-8 as default locales. By now, when you output your locales settings with locale command, all the variables with “LC_XXX” shoud be already in “en_US.UTF-8“.
- Displaying Chinese
There are a few packages you need to get in order to get chinese text displayed correctly in your KDE desktop.
These are for KDE Internationalization.- kde-i18n-zhcn (for Simplified Chinese)
- kde-i18n-zhtw (for Big5 Chinese)
You can always add your desired encoding for other languages. I have also kde-i18n-ko for korean, and kde-i18n-ja for Japan.
After installing the internationalized packages, you will have to install TTF(true type fonts). Here’s the list.- ttf-arphic-bkai00mp (“AR PL KaitiM Big5″ Chinese TrueType font)
- ttf-arphic-bsmi00lp (“AR PL Mingti2L Big5″ Chinese TrueType font)
- ttf-arphic-gbsn00lp (“AR PL SungtiL GB” Chinese TrueType font)
- ttf-arphic-gkai00mp (“AR PL KaitiM GB” Chinese TrueType font)
- ttf-arphic-uming (“AR PL ShanHeiSun Uni” Chinese Unicode TrueType font)
- ttf-fireflysung (“AR PL New Sung” Chinese TrueType font)
- ttf-kochi-gothic-naga10 (Kochi Subst Gothic Japanese TrueType font)
My default chinese font is ttf-fireflysung which I’ve forgot where to get. I remember getting it from a Taiwan site, if any of you have the address, please kindly let me know. If you are unable to get firefly, uming is probably your best choice for chinese text.
- Changing font for chinese text display
Sometimes in your KDE desktop, if you have downloaded files with chinese/japanese file names, it will be displayed in square unreadable characters. This means KDE is unable to find appropriate font substitution for unknown characters. You can get qt3-qtconfig to deal with this problem. Inside the program you will get to set font substitution for your default KDE font(mine is Bitstream Vera). Apply several substitution TTFs like AR PL New Sung and AR PL ShanHeiSun Uni, so your text will be displayed correctly.For other programs like Firefox, Xchat, amarok and more. You will get to choose their own default font. For my case, once qt3-qtconfig is set properly, these programs have no problem using the settings.
If above methods still do not work out for you. You can try also install gtk2-engines-gtk-qt. This program will use your Qt settings to draw your GTK applications’ user interface, including the fonts of course. You should also check with
Codes:
update-alternatives --config qtconfig
to see whether which qt config is currently in use. If you have used qt3-qtconfig, you definitely should choose “/usr/bin/qtconfig-qt3″ as your default.
- Chinese Input Method
IMO, scim is always the best choice because it has pinyin support, the only chinese input method I’m familiar with. You will have to get these packages.- scim
- scim-chinese
- scim-gtk2-immodule
- scim-modules-socket
- scim-pinyin
- libscim8c2a
In order to get scim to work in almost everywhere in KDE, some settings need to be done.
First, in your ~/.bashrc file, add in this line.Codes:
export LC_CTYPE="zh_CN.UTF-8"
This will export your LC_TYPE as zh_CN.UTF-8 since we have already set all these to en_US.UTF-8. This is per user’s local setting, for my case I’ve set my LC_TYPE to zh_CN.UTF-8 system wide, with this command.
Codes:
dpkg-reconfigure localesconf
Use this command to set scim as your default input method for X.
Codes:
update-alternatives --config xinput-all_ALL
Again this is my system wide setting. For user’s local setting, add these lines in your ~/.bashrc
Codes:
export XIM=SCIM
export XIM_PROGRAM=/usr/bin/scim
export XIM_ARGS="-d"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
Restart your X-server, and login to KDE. In any text input field(Gaim, Firefox, Xchat, Open Office, Thunderbird and more), when you hit CTRL+Space, the scim toolbar will pop up and you are able to input chinese text. CTRL+Space again to switch back to English.
Remember not to install the Skim(KDE frontend for scim), as it will somehow freeze your keyboard frequently.
Again, discussions are welcome. I need more feedback on this topic please.
Update #1: I have found a very useful page at unifont.org, you might want to check it out.

ttf-fireflysung (â€AR PL New Sung†Chinese TrueType font)
is available from
http://www.study-area.org/apt/firefly-font/
(as well mentionning http://www.unifont.org/fontguide/ as a reference)
Thanks dude, glad to have someone reading this.
Thank you for the hint, that skim freezes the input. I just stumbled upon that problem…
You’re welcome.
i think that editng .bashrc file don’t have effect to KDE-program,because .bashrc file only run only when you open terminal-window,
if i don’t open any terminal-window,then .bashrc file will not run,so envirmont-viriant will not change as you expect.
maybe you should think again What to set and How to set in order to efect KDE-program
Hi! Big Sea. Do you mean that your ~/.bashrc does not load when loading up a User Account? Please provide more details, thanks. P/S: I can read Chinese(PRC) too.
ä¸¥å®¾ï¼Œä½ å¥½ï¼Œä½ ä¸€å®šæ˜¯ä¸å›½äººäº†å§ã€‚看åå—åƒæ˜¯ã€‚
æˆ‘çš„æ„æ€æ˜¯ï¼š.bashrcè¿™ä¸ªæ–‡ä»¶åªæœ‰åœ¨ä½ å¯åŠ¨ä¸€ä¸ª’终端窗å£â€œçš„æ—¶å€™ï¼Œæ‰ä¼šæ‰§è¡Œï¼Œä¾‹å¦‚è¯´ï¼šä½ ä¸»åŠ¨çš„å¯åŠ¨äº†konsole这个“终端模拟窗å£â€ç¨‹åºï¼Œ.bashrcæ‰ä¼šæ‰§è¡Œã€‚
ä»Žç”µè„‘åŠ ç”µå¯åŠ¨ï¼Œä¸€ç›´åˆ°å‡ºçŽ°kde桌é¢è¿™ä¸ªè¿‡ç¨‹å½“ä¸ï¼Œ.bashrcè¿™ä¸ªâ€œå¯æ‰§è¡Œè„šæœ¬â€å¹¶ä¸ä¼šè‡ªåŠ¨æ‰§è¡Œï¼Œè‡ªç„¶çŽ¯å¢ƒå˜é‡ä¹Ÿå°±æ— 法被æ£ç¡®çš„设置了。
如果电脑å¯åЍ之åŽï¼Œç›´æŽ¥è¿›å…¥åˆ°â€œ å—符模始“,(ä¸å¯åЍKDE),那么.bashrc也会执行。
bash是一个“å—符命令解释程åºâ€ï¼Œè€Œ
.bashrc这个文件是它的“åˆå§‹åŒ–æ–‡ä»¶â€œï¼Œåªæœ‰bash至少è¿è¡Œä¸€æ¬¡ï¼Œ .bashrcæ‰ä¼šæœ‰æœºä¼šæ‰§è¡Œã€‚
如果电脑直接进入到kde桌é¢ï¼Œé‚£ä¹ˆbashç¨‹åºæ ¹æœ¬ä¸ä¼šå¯åŠ¨ï¼Œ.bashrc也自然ä¸ä¼šæ‰§è¡Œã€‚
我刚æ‰ä¸Šç½‘查了一些资料,å—到了å¯å‘。改了改 /etc/X11/xinit/xinput.dè¿™ä¸ªç›®å½•ä¸‹çš„å‡ ä¸ªæ–‡ä»¶ï¼Œé‡æ–°ç™»å½•KDE,果真有效果,å¯ä»¥â€œåˆ‡æ¢â€è¾“入法了。“智能拼音â€ç»ˆäºŽå‡ºæ¥äº†ã€‚è¿™å‡ ä¸ªæ–‡ä»¶æ˜¯ scim,scim-immodule,zh_CN。
ä¸ºä»€ä¹ˆæ”¹è¿™ä¸ªç›®å½•ä¸‹çš„æ–‡ä»¶å°±æœ‰æ•ˆæžœå‘¢ï¼Ÿæˆ‘è®¤ä¸ºæ˜¯è¿™æ ·çš„ï¼šKDEå¯åŠ¨çš„æ—¶å€™ï¼Œå¿…ç„¶è¦è°ƒç”¨X serverï¼Œå› æ¤ä¿®æ”¹X server的“åˆå§‹åŒ–â€æ–‡ä»¶ï¼Œè‚¯å®šä¼šæœ‰æ•ˆæžœã€‚那它的â€åˆå§‹åŒ–“文件在那里呢?
看看 /etc/X11/ 目录下的 xinit 这个åå—,应该是 x initial 的简写å§ã€‚也就是“ X åˆå§‹åŒ–“。xinput.d è¿™ä¸ªç›®å½•ï¼Œé¡¾åæ€æ„,跟输入法有关系。我å‘现上诉三个文件当ä¸çš„ GTK_IM_MODULE å’Œ QT_IM_MODULE 这两个å˜é‡åˆå§‹å€¼éƒ½è¢«è®¾ç½®æˆäº†xim,我把他们的å–值改æˆäº†scim,注销用户,å†ç™»å½•,输入法终于æ£å¸¸äº†ã€‚
我å‰å‡ 天,刚刚下了Debain 4.0,刻盘安装,åˆåŠ è£…äº†å¥½å¤šä¸ªåå—ä¸åŒ…嫿œ‰scimçš„debåŒ…ï¼Œä½†å§‹ç»ˆæ— æ³•åˆ‡æ¢åˆ°ä¸æ–‡è¾“å…¥æ³•ã€‚è¿žç»æœå¯»äº†å‡ å¤©ï¼Œä¸€æ— æ‰€èŽ·ã€‚ä»Šå¤©ï¼Œå¶ç„¶ä¸€ä¸ªæœºä¼šï¼Œçœ‹äº†ä¸€ç¯‡è‹±æ–‡å¸–å,å—到å¯å‘,å°è¯•ç€æ”¹äº†æ”¹æˆ‘ä¸Šé¢æåˆ°çš„ä¸‰ä¸ªæ–‡ä»¶ï¼Œç»ˆäºŽçœ‹åˆ°çº¢è‰²çš„â€æ™ºâ€å—出现在了输入法指示区。
看æ¥ï¼Œä¿®æ”¹å“ªä¸ªé…置文件是很é‡è¦çš„,没找准åˆé€‚的文件,费了劲,也没有效果。
冿¤è¿‡ç¨‹å½“ä¸ï¼Œæˆ‘ä¹Ÿçœ‹äº†ä½ çš„è¿™ç¯‡æ–‡ç« ï¼Œä¹Ÿé‡‡ç”¨äº†ä½ çš„ä¸€äº›æ–¹æ³•ï¼Œæ·±è¡¨æ„Ÿè°¢ã€‚éš¾å¾—ä½ è¿˜â€œç¿»è¯‘â€æˆè‹±æ–‡ã€‚
Big Sea, 大海。
我明白了。
其实这个指令 “update-alternatives –config xinput-all_ALL” 和修改 /etc/X11/xinit/xinput.d æ˜¯ä¸€æ ·çš„ã€‚ .bashrc 的修改就是为了能在Konsole里输入。
ä¸é¼“励使用stable, 软件好旧。 Unstable也很好用。
æˆ‘ä¸æ–‡å是延斌。 马æ¥è¥¿äºšåŽè£”。有没有MSN啊?
Hey, i’m using gnome, do i follow the same steps or something else?help please. Thanks
Hi Bill, can your Web Browser display chinese text now?