old-www/HOWTO/Chinese-HOWTO-9.html

309 lines
12 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Linux Chinese HOWTO English Version: Related Chinese Problems with Others</TITLE>
<LINK HREF="Chinese-HOWTO-10.html" REL=next>
<LINK HREF="Chinese-HOWTO-8.html" REL=previous>
<LINK HREF="Chinese-HOWTO.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="Chinese-HOWTO-10.html">Next</A>
<A HREF="Chinese-HOWTO-8.html">Previous</A>
<A HREF="Chinese-HOWTO.html#toc9">Contents</A>
<HR>
<H2><A NAME="other"></A> <A NAME="s9">9. Related Chinese Problems with Others</A></H2>
<H2><A NAME="netscape"></A> <A NAME="ss9.1">9.1 Netscape Navigator</A>
</H2>
<P>Netscape 2.0 or later support both BIG5 and GB codes, which have already discussed on several homepages. To display Chinese in Netscape, there are three steps:
<OL>
<LI>Install Chinese fonts of X. Refer to the section
<A HREF="Chinese-HOWTO-5.html#xfont">Installing Chinese Fonts</A> .</LI>
<LI>Run <CODE>netscape</CODE>, and configure <CODE>Document Encoding</CODE> as <CODE>Traditional Chinese (Big5)</CODE> or <CODE>Simplified Chinese</CODE>.
<UL>
<LI>In Netscape 2.x or 3.x, this will configure at <CODE>Options/Document Encoding/...</CODE>.</LI>
<LI>In Netscape Communicator 4.x, configure it at <CODE>View/Encoding/...</CODE>.</LI>
</UL>
</LI>
<LI>Select the Chinese fonts you want.
<UL>
<LI>In Netscape 2.x, 3.x, configure it at <CODE>Options/General Preferences/Fonts</CODE>.</LI>
<LI>In Netscape Communicator 4.x, configure it at <CODE>Edit/Preferences.../Appearance/Fonts</CODE>.</LI>
</UL>
</LI>
</OL>
Maybe you will feel so strange that why you can only use <CODE>Fixed(HKU) Size 16.0</CODE>, which is causing from the settings in <CODE>/usr/X11R6/lib/X11/app-defaults/Netscape</CODE>.
Assuming that you have the following BIG5 fonts:
<BLOCKQUOTE><CODE>
<PRE>
# xlsfonts | grep big5
-hku-fixed-medium-r-normal--0-0-72-72-c-0-big5.hku-0
-hku-fixed-medium-r-normal--16-160-72-72-c-160-big5.hku-0
-kc-kai-medium-r-normal-fantizi-0-0-75-75-c-0-big5.eten.3.10-1
-kc-kai-medium-r-normal-fantizi-20-200-75-75-c-200-big5.eten.3.10-1
-kc-kai-medium-r-normal-fantizi-24-240-75-75-c-240-big5.eten.3.10-1
-kc-ming-medium-r-normal-fantizi-0-0-75-75-c-0-big5.eten.3.10-1
-kc-ming-medium-r-normal-fantizi-15-150-75-75-c-160-big5.eten.3.10-1
-kc-ming-medium-r-normal-fantizi-24-240-75-75-c-240-big5.eten.3.10-1
</PRE>
</CODE></BLOCKQUOTE>
Add one line to <CODE>/usr/X11R6/lib/X11/app-defaults/Netscape</CODE>
<BLOCKQUOTE><CODE>
<PRE>
*documentFonts.charset*big5.eten.3.10-1: x-x-big5
</PRE>
</CODE></BLOCKQUOTE>
Then, Netscape can use these fonts well.
<P>Another solution is to name aliases for your fonts's names: Adding aliases in the <CODE>fonts.alias</CODE> file(create it yourself if there is no such a file) under your fonts directory.
<BLOCKQUOTE><CODE>
<PRE>
-big5-taipeik-medium-r-normal--16-160-72-72-c-160-big5.hku-1 taipei16
-big5-taipeik-medium-r-normal--20-200-72-72-c-200-big5.hku-1 taipeik20
-big5-taipeik-medium-r-normal--24-240-72-72-c-240-big5.hku-1 taipeik24
</PRE>
</CODE></BLOCKQUOTE>
<P>The fonts filenames, like <CODE>taipeik20</CODE>, are that you need to give aliases to them. After modification, do
<BLOCKQUOTE><CODE>
<PRE>
# xset fp rehash
</PRE>
</CODE></BLOCKQUOTE>
to reload fonts's names to make them available.
<P>You may find that the sizes of Chinese and English are out of proportion in homepages of Chinese-English languages(such as too small English words), which is the reason that what you've selected for English fonts and Chinese fonts is unbalanced at the magnitude. Go back to the configuration for fonts, and select Western(iso-8859-1). Then, in your opinion, change the size of English fonts to make it perfect in proportions.
<P>
<H2><A NAME="sendmail"></A> <A NAME="ss9.2">9.2 sendmail</A>
</H2>
<P>Because defaults of <CODE>sendmail 8.8.x</CODE> will encode all 8-bit mails first before sending them out, which may or may not reduce influences to those receiver. (Refer to
<A HREF="#procmail">Next Sub-Section</A> for solutions).
Most hosts can directly send 8-bit mails now, so you had better re-compile <CODE>sendmail</CODE> and close the encoding ability.
<P>
<UL>
<LI>Get the newest version from this site(or mirror site):
<BLOCKQUOTE>
<A HREF="ftp://ftp.sendmail.org/ucb/src/sendmail/">ftp://ftp.sendmail.org/ucb/src/sendmail/</A></BLOCKQUOTE>
</LI>
<LI>Decompress it and modify <CODE>Makefile</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
# tar zxvf sendmail-8.8.8.tar.gz
# cd src/Makefiles
# chmod u+w Makefile.Linux
# vi Makefile.Linux
</PRE>
</CODE></BLOCKQUOTE>
Add <CODE>-DMIME8TO7=0</CODE> after <CODE>CFLAGS+=</CODE>. </LI>
<LI>Compile and install <CODE>sendmail</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
# cd ..
# ./makesendmail all install
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>Install man pages to the exact directory manually(It's ok if not installing). </LI>
<LI>Erase the old <CODE>sendmail</CODE> process:
<BLOCKQUOTE><CODE>
<PRE>
# kill -9 `head -1 /var/run/sendmail.pid`
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>Restart <CODE>sendmail</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
# /usr/sbin/sendmail -bd -q1h
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
<P>
<H2><A NAME="procmail"></A> <A NAME="ss9.3">9.3 procmail</A>
</H2>
<P><CODE>procmail</CODE> is an electronic mail filter, which can manipulate mails first before storing them into your mailbox, for example, classification for mails and so on.
Though, I want to teach you how to make use of <CODE>procmail</CODE> to uncode the encoded ones into pure text files and how to convert the various encoded mails into common encoding you used here.
<P>Create <CODE>.procmailrc</CODE> file under your home directory, listed as follows:
<HR>
<PRE>
# To avoid accidents, store mails before using procmail.
# You can filter mails to ensure which mail doesn't need to duplicate
# by, for example, MAILER-DAEMON.
:0 c
* !^From.*MAILER-DAEMON
mail/procmail-backup
# Uncode mails encoded by quoted-printable or base64.
:0
* ^Content-Type: *text/plain
{
:0 fbw
* ^Content-Transfer-Encoding: *quoted-printable
| mimencode -u -q
:0 Afhw
| formail -I "Content-Transfer-Encoding: 8bit" \
-I "X-Mimed-Autoconverted: quoted-printable to 8bit by procmail"
:0 fbw
* ^Content-Transfer-Encoding: *base64
| mimencode -u -b
:0 Afhw
| formail -I "Content-Transfer-Encoding: 8bit" \
-I "X-Mimed-Autoconverted: base64 to 8bit by procmail"
}
# Here will judge whether a mail is GB codes or not; if it is, convert it
# into BIG5 codes. If you want to convert BIG5 codes into GB codes, you
# need to exchange big5 with gb2312 and replace 'hc -m b2g' with 'hc -m g2b'.
:0
* ^Content-Type:.*text/plain;.*charset=gb2312
{
:0 fw
| hc -m b2g -t /usr/local/lib/chinese/hc.tab
:0 Afhw
| formail -I "Content-Type: text/plain; charset=big5" \
-I "X-Charset-Autoconverted: gb2312 to big5 by procmail"
}
# Store mails into mailbox.
:0:
${ORGMAIL}
</PRE>
<HR>
<P>In this case, integrating with <CODE>mimencode</CODE>, <CODE>formail</CODE> to decode mails, and use <CODE>
<A HREF="Chinese-HOWTO-8.html#hc">hc</A></CODE> to convert GB codes mails into BIG5 codes mails. Thus, you have to install these tools in order to use procmail.
<P>Eventually, rectify your <CODE>.forward</CODE> file.
<BLOCKQUOTE><CODE>
<PRE>
"|IFS=' ' &amp;&amp; exec /usr/bin/procmail -f- ~/.procmailrc ||exit 75 #login"
</PRE>
</CODE></BLOCKQUOTE>
<B>Notes</B>: change the <CODE>login</CODE> as your login name.
<P>
<H2><A NAME="telnet"></A> <A NAME="ss9.4">9.4 telnet</A>
</H2>
<P>If you can access Chinese on your own machine, but cannot access Chinese while telnet to other machines, then the problems may cause from <CODE>telnet</CODE> itself.
When telnet is being under connection, you can press <CODE>Ctrl-]</CODE> to jump out temporarily, and enter <B>set binary</B> at the prompt of <CODE>telnet></CODE> to assure the fully transmission of bits.
You can also use <CODE>telnet -8</CODE> to make connections (but it seems won't work for some sites...?).
Another more simple method is to use directly a 8-bit <CODE>telnet</CODE> program. Download the binary file from here:
<BLOCKQUOTE>
<A HREF="ftp://linux.cis.nctu.edu.tw/packages/chinese/misc/">ftp://linux.cis.nctu.edu.tw/packages/chinese/misc/</A></BLOCKQUOTE>
<P>
<H2><A NAME="ss9.5">9.5 less</A>
</H2>
<P><CODE>less</CODE> itself can display Chinese directly; just set the following environment variable can Chinese display:
<BLOCKQUOTE><CODE>
<PRE>
# export LESSCHARSET=latin1
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss9.6">9.6 pine</A>
</H2>
<P>Pine of version 3.95 later can support reading and entering Chinese mails. As you execute pine, select <CODE>SETUP/Config</CODE> in <CODE>feature list</CODE>, choose this(hit <CODE>X</CODE>):
<BLOCKQUOTE><CODE>
<PRE>
[X] enable-8bit-esmtp-negotiation
[X] enable-8bit-nntp-posting
</PRE>
</CODE></BLOCKQUOTE>
<P>Then, hit <CODE>C</CODE> on <CODE>character-set</CODE>, and change its value to big5 or gb2312.
Finally, hit <CODE>E</CODE> to escape and store this change.
<P>You can also install the cpine capable of showing Chinese messages:
<BLOCKQUOTE>
<A HREF="ftp://ftp.vit.edu.tw/unix/linux/chinese/cpine-3.91.bin.tgz">ftp://ftp.vit.edu.tw/unix/linux/chinese/cpine-3.91.bin.tgz</A></BLOCKQUOTE>
<P>
<H2><A NAME="ss9.7">9.7 samba</A>
</H2>
<P>
<UL>
<LI>At first, take the newest version of samba-1.9.17p5 and big5 patch home.
<BLOCKQUOTE>
<A HREF="ftp://linux.cis.nctu.edu.tw/packages/network/samba/samba-1.9.17p5.tar.gz">ftp://linux.cis.nctu.edu.tw/packages/network/samba/samba-1.9.17p5.tar.gz</A><BR>
<A HREF="ftp://linux.cis.nctu.edu.tw/packages/chinese/samba-big5-patch/samba-1.9.17p2-BIG5-patch-0.gz">ftp://linux.cis.nctu.edu.tw/packages/chinese/samba-big5-patch/samba-1.9.17p2-BIG5-patch-0.gz</A></BLOCKQUOTE>
</LI>
<LI>Decompress samba-1.9.17p5.tar.gz, and add the patch upon:
<BLOCKQUOTE><CODE>
<PRE>
# tar zxvf samba-1.9.17p5.tar.gz
# cd samba-1.9.17p5/source
# zcat samba-1.9.17p2-BIG5-patch-0.gz | patch -s
</PRE>
</CODE></BLOCKQUOTE>
</LI>
<LI>According to the normal procedures, you can compile and install it. Refer to the
<A HREF="http://samba.anu.edu.au/samba/">Samba HomePage</A>.</LI>
</UL>
<P>
<H2><A NAME="ss9.8">9.8 lynx</A>
</H2>
<P>
<A HREF="http://lynx.browser.org/">Lynx</A> v2.7 can view Chinese homepages directly. Execute lynx, and press <CODE>O)ption</CODE> / <CODE>C)haracter set</CODE>, and then choose <CODE>Taipei(Big5)</CODE> by arrow keys, and finally press '>' to store this set.
<P>
<H2><A NAME="ss9.9">9.9 minicom</A>
</H2>
<P>Use the switch <CODE>-l</CODE> to start <CODE>minicom</CODE>, then you can see Chinese in minicom.
<P>
<H2><A NAME="ss9.10">9.10 fingerd</A>
</H2>
<P>If you type Chinese in your <CODE>.plan</CODE> but can't be saw by others, this is probably caused by the inability of <CODE>fingerd</CODE> to send out 8-bit Chinese words.
Get <CODE>cfingerd</CODE> from this site:
<BLOCKQUOTE>
<A HREF="ftp://nctuccca.edu.tw/OS/Linux/packages/network/finger/cfingerd-1.3.2.tar.gz">ftp://nctuccca.edu.tw/OS/Linux/packages/network/finger/cfingerd-1.3.2.tar.gz</A></BLOCKQUOTE>
<P>Decompress it and execute <CODE>./Configure</CODE>, then implement <CODE>make all</CODE> .
<P>Then, modify <CODE>/etc/inetd.conf</CODE>, changing the original <CODE>finger</CODE> to:
<BLOCKQUOTE><CODE>
<PRE>
finger stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.cfingerd
</PRE>
</CODE></BLOCKQUOTE>
<P>Let <CODE>inetd</CODE> read the configuration file again:
<BLOCKQUOTE><CODE>
<PRE>
# kill -HUP `cat /var/run/inetd.pid`
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss9.11">9.11 tintin++</A>
</H2>
<P>The TinTin++ is not a Chinese software but just a useful tool when playing Chinese mud.You can download it from this place:
<BLOCKQUOTE>
<A HREF="ftp://ftp.princeton.edu/pub/tintin++">ftp://ftp.princeton.edu/pub/tintin++</A></BLOCKQUOTE>
<P>Here are some Chinese mud sites:
<BLOCKQUOTE><CODE>
<PRE>
FengYun fengyun.com 5555
Xi You Ji 129.105.79.24 6905
Xia ke Xing 207.76.64.2 5555
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>
<HR>
<A HREF="Chinese-HOWTO-10.html">Next</A>
<A HREF="Chinese-HOWTO-8.html">Previous</A>
<A HREF="Chinese-HOWTO.html#toc9">Contents</A>
</BODY>
</HTML>