Wednesday, July 11, 2007

Mac上的Terminal

Unix Terminal Emulators

There are two levels of Chinese support that must be addressed. The first is in the Unix terminal emulation software, which needs to be set up to emulate a localized Chinese Unix terminal in order to handle double-byte Chinese character set encodings (as opposed to handling Chinese with Unicode). See the entries below for some details.

The second level is in the Unix operating system. The shell environment variables have to be set to the corresponding Chinese locale (when connecting to a localized Chinese server, for example). You can either type in the commands manually at the command line or add them to your ~/.cshrc file. Both terminal emulators start up with the default shell (tcsh, for example). When tcsh starts, it looks for and reads a number of initialization files. One of those files is ~/.cshrc. Placing setenv commands in the ~/.cshrc file ensures that the locale is set at startup and saves you the trouble of manually typing the commands every time.

Commands for the tcsh shell and Traditional Chinese locale (Big Five character set):

setenv LC_CTYPE zh_TW.Big5
setenv LANG zh_TW.Big5

Commands for the tcsh shell and Simplified Chinese locale (GB 2312 character set):

setenv LC_CTYPE zh_CN.EUC
setenv LANG zh_CN.EUC

To upload or download files containing Chinese, you must set the FTP transfer mode to binary format before you enter the get or put commands.

Apple Terminal

OS X only, in the /Applications/Utilities folder. This discussion is based on Terminal 1.4.1 in OS X 10.3.

UTF-8 is the default setting, and you can enter Unicode Chinese characters using the Character Palette without changing any settings. Other standard Chinese character set encodings are available in Terminal > Window Settings... Display, and thus Terminal shell windows can be set up to emulate localized Chinese Unix terminals.

iTerm

OS X only. iTerm is an open-source project focused on multilingual support, including Unicode and all standard East Asian encodings. Change the encoding in Preferences > Shell settings to set up iTerm to emulate a localized Chinese Unix terminal.

http://iterm.sourceforge.net/

以上来自http://www.yale.edu/chinesemac/pages/internet.html

其他资料:

http://tristan.ethereal.net/osx/terminal.html

http://apple.slashdot.org/article.pl?sid=03/06/09/1754234

http://www.rift.dk/news.php?item.7.6

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home