Remove zh-tut, that's non-FDP-compliant document.
Submitted by: hrs@ with docung hat. -- Mayday! Mayday! Huston, we have problem...
svn path=/head/; revision=28237
|
|
@ -1,139 +0,0 @@
|
|||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# Build the FreeBSD Handbook.
|
||||
#
|
||||
|
||||
MAINTAINER= statue@freebsd.sinica.edu.tw
|
||||
|
||||
DOC?= zh-tut
|
||||
|
||||
FORMATS?= html-split
|
||||
|
||||
INSTALL_COMPRESSED?= gz
|
||||
INSTALL_ONLY_COMPRESSED?=
|
||||
|
||||
DSLHTML= freebsd.dsl
|
||||
DSLPRINT= freebsd.dsl
|
||||
#
|
||||
# SRCS lists the individual SGML files that make up the document. Changes
|
||||
# to any of these files will force a rebuild
|
||||
#
|
||||
|
||||
# SGML content
|
||||
SRCS= zh-tut.sgml
|
||||
SRCS+= chapters/ack.sgml
|
||||
SRCS+= chapters/compose.sgml
|
||||
SRCS+= chapters/converter.sgml
|
||||
SRCS+= chapters/charmap.sgml
|
||||
SRCS+= chapters/devel.sgml
|
||||
SRCS+= chapters/dict.sgml
|
||||
SRCS+= chapters/difficult.sgml
|
||||
SRCS+= chapters/faq.sgml
|
||||
SRCS+= chapters/fonts.sgml
|
||||
SRCS+= chapters/l10n.sgml
|
||||
SRCS+= chapters/mailclient.sgml
|
||||
SRCS+= chapters/message.sgml
|
||||
SRCS+= chapters/multimedia.sgml
|
||||
SRCS+= chapters/net.sgml
|
||||
SRCS+= chapters/other.sgml
|
||||
SRCS+= chapters/outta.sgml
|
||||
SRCS+= chapters/preface.sgml
|
||||
SRCS+= chapters/print.sgml
|
||||
SRCS+= chapters/software.sgml
|
||||
SRCS+= chapters/stepbystep.sgml
|
||||
SRCS+= chapters/view.sgml
|
||||
SRCS+= chapters/wm.sgml
|
||||
SRCS+= chapters/xwin.sgml
|
||||
|
||||
# Entities
|
||||
SRCS+= authors.ent
|
||||
SRCS+= chapters.ent
|
||||
|
||||
IMAGES= images/20020527-2.png
|
||||
IMAGES+= images/20020527.png
|
||||
IMAGES+= images/Eterm.png
|
||||
IMAGES+= images/IglooFTP.png
|
||||
IMAGES+= images/abiword.png
|
||||
IMAGES+= images/acroread.png
|
||||
IMAGES+= images/applet.png
|
||||
IMAGES+= images/arphicttf.png
|
||||
IMAGES+= images/aterm.png
|
||||
IMAGES+= images/bbsnet.png
|
||||
IMAGES+= images/bg5pdf.png
|
||||
IMAGES+= images/bg5ps.png
|
||||
IMAGES+= images/big5con.png
|
||||
IMAGES+= images/cccii.png
|
||||
IMAGES+= images/cce.png
|
||||
IMAGES+= images/cid-gv.png
|
||||
IMAGES+= images/cjk.png
|
||||
IMAGES+= images/cjk-lyx.png
|
||||
IMAGES+= images/cwtexttf.png
|
||||
IMAGES+= images/cxterm.png
|
||||
IMAGES+= images/dict.png
|
||||
IMAGES+= images/dvipdfmx.png
|
||||
IMAGES+= images/edict-big5.png
|
||||
IMAGES+= images/fzzdxfw.png
|
||||
IMAGES+= images/fortunetw.png
|
||||
IMAGES+= images/gaim.png
|
||||
IMAGES+= images/gnuls.png
|
||||
IMAGES+= images/hanzim.png
|
||||
IMAGES+= images/hztty.png
|
||||
IMAGES+= images/irssi.png
|
||||
IMAGES+= images/joe.png
|
||||
IMAGES+= images/kde-print.png
|
||||
IMAGES+= images/kfont_3_1.png
|
||||
IMAGES+= images/kmerlin.png
|
||||
IMAGES+= images/konq_3_1.png
|
||||
IMAGES+= images/konq_3_2.png
|
||||
IMAGES+= images/konq_3_3.png
|
||||
IMAGES+= images/konq_3_4.png
|
||||
IMAGES+= images/konqueror.png
|
||||
IMAGES+= images/konsole.png
|
||||
IMAGES+= images/ldap.png
|
||||
IMAGES+= images/lynx.png
|
||||
IMAGES+= images/licq.png
|
||||
IMAGES+= images/man.png
|
||||
IMAGES+= images/mlterm.png
|
||||
IMAGES+= images/mplayer.png
|
||||
IMAGES+= images/moefonts-cid.png
|
||||
IMAGES+= images/moettf.png
|
||||
IMAGES+= images/mozilla.png
|
||||
IMAGES+= images/mutt.png
|
||||
IMAGES+= images/nautilus.png
|
||||
IMAGES+= images/ncftp3.png
|
||||
IMAGES+= images/ntfs.png
|
||||
IMAGES+= images/ntuttf.png
|
||||
IMAGES+= images/openoffice.png
|
||||
IMAGES+= images/oxford.png
|
||||
IMAGES+= images/php-imagettftext.png
|
||||
IMAGES+= images/php-pdf.png
|
||||
IMAGES+= images/pydict.png
|
||||
IMAGES+= images/qe.png
|
||||
IMAGES+= images/qkmj.png
|
||||
IMAGES+= images/qterm.png
|
||||
IMAGES+= images/rxvt.png
|
||||
IMAGES+= images/showttf.png
|
||||
IMAGES+= images/stardict.png
|
||||
IMAGES+= images/stardict2.png
|
||||
IMAGES+= images/swing.png
|
||||
IMAGES+= images/sylpheed.png
|
||||
IMAGES+= images/tcltk.png
|
||||
IMAGES+= images/tcsh.png
|
||||
IMAGES+= images/tin.png
|
||||
IMAGES+= images/tintin++.png
|
||||
IMAGES+= images/ttf2pt1.png
|
||||
IMAGES+= images/ve.png
|
||||
IMAGES+= images/vim.png
|
||||
IMAGES+= images/vnc.png
|
||||
IMAGES+= images/wangttf.png
|
||||
IMAGES+= images/windowmaker.png
|
||||
IMAGES+= images/xchat.png
|
||||
IMAGES+= images/xcin25.png
|
||||
IMAGES+= images/xmms.png
|
||||
IMAGES+= images/xpdf.png
|
||||
IMAGES+= images/zhcon.png
|
||||
|
||||
URL_RELPREFIX?= ../../../..
|
||||
DOC_PREFIX?= ${.CURDIR}/../../..
|
||||
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!--
|
||||
Names and email address of contributing authors and CVS committers.
|
||||
Entity names for committers should be the same as their login names on
|
||||
freefall.FreeBSD.org.
|
||||
|
||||
Use these entities when referencing people.
|
||||
|
||||
Please keep this list in alphabetical order by entity names.
|
||||
|
||||
$FreeBSD$
|
||||
Original revision: 1.9
|
||||
-->
|
||||
|
||||
<!ENTITY a.statue "Shen Chun-Hsing <email>statue@freebsd.sinica.edu.tw</email>">
|
||||
<!ENTITY a.clive "Clive T. Lin<email>clive@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.cschin "Chen-Shan Chin <email>cschin@u.washington.edu</email>">
|
||||
<!ENTITY a.cwhuang "cwhuang <email>cwhuang@phys.ntu.edu.tw</email>">
|
||||
<!ENTITY a.cwweng "Chih-Wei Weng <email>cwweng@mail.ep.nctu.edu.tw</email>">
|
||||
<!ENTITY a.edwardlee "Edward G.J. Lee <email>EdwardLee@bbs.ee.ntu.edu.tw</email>">
|
||||
<!ENTITY a.foxfair "Foxfair Hu <email>foxfair@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.gslin "Gea-Suan Lin <email>gslin@ccca.nctu.edu.tw</email>">
|
||||
<!ENTITY a.ijliao "Ying-chieh Liao <email>ijliao@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.jdli "jdli <email>jdli@csie.nctu.edu.tw</email>">
|
||||
<!ENTITY a.jerry "jerry <email>jerry@mail.hantop.com.tw</email>">
|
||||
<!ENTITY a.joelu "Joe Lu <email>JoeLu@freebsd.ee.ntu.edu.tw</email>">
|
||||
<!ENTITY a.keichii "Michael C. Wu <email>keichii@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.keith "Jing-Tang Keith Jang <email>keith@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.kevlo "Kevin Lo <email>kevlo@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.kuang.c.w "Kuang-che Wu <email>b88062@csie.ntu.edu.tw</email>">
|
||||
<!ENTITY a.leeym "Yen-Ming Lee <email>leeym@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.mhsin "mhsin <email>b7506043@csie.ntu.edu.tw</email>">
|
||||
<!ENTITY a.platin "platin <email>platin@ms31.hinet.net</email>">
|
||||
<!ENTITY a.srlee "§õªYèû <email>srlee@csie.nctu.edu.tw</email>">
|
||||
<!ENTITY a.tung.c.k "Chung-Kie Tung <email>tung@turtle.ee.ncku.edu.tw</email>">
|
||||
<!ENTITY a.thhsieh "thhsieh <email>thhsieh@linux.org.tw</email>">
|
||||
<!ENTITY a.vanilla "Vanilla I. Shu <email>vanilla@FreeBSD.ORG</email>">
|
||||
<!ENTITY a.weijr "weijr <email>weijr.bbs@bbs.ntu.edu.tw</email>">
|
||||
<!ENTITY a.ycheng "Yuan-Chen Cheng <email>ycheng@sinica.edu.tw</email>">
|
||||
<!ENTITY a.yinjieh "yinjieh <email>yinjieh@csie.nctu.edu.tw</email>">
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
<!-- $FreeBSD$ -->
|
||||
<!DOCTYPE chapter PUBLIC "-//FreeBSD//DTD DocBook V3.1-Based Extension//EN">
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<!--
|
||||
Creates entities for each chapter in the FreeBSD Handbook. Each entity
|
||||
is named chap.foo, where foo is the value of the id attribute on that
|
||||
chapter, and corresponds to the name of the directory in which that
|
||||
chapter's .sgml file is stored.
|
||||
|
||||
Chapters should be listed in the order in which they are referenced.
|
||||
|
||||
$FreeBSD$
|
||||
Original revision: 1.13
|
||||
-->
|
||||
|
||||
<!-- Part one -->
|
||||
<!ENTITY chap.preface SYSTEM "chapters/preface.sgml">
|
||||
<!ENTITY chap.stepbystep SYSTEM "chapters/stepbystep.sgml">
|
||||
<!ENTITY chap.dict SYSTEM "chapters/dict.sgml">
|
||||
<!ENTITY chap.difficult SYSTEM "chapters/difficult.sgml">
|
||||
<!ENTITY chap.environment SYSTEM "chapters/environment.sgml">
|
||||
<!ENTITY chap.fetch SYSTEM "chapters/fetch.sgml">
|
||||
<!ENTITY chap.xwin SYSTEM "chapters/xwin.sgml">
|
||||
<!ENTITY chap.message SYSTEM "chapters/message.sgml">
|
||||
<!ENTITY chap.fonts SYSTEM "chapters/fonts.sgml">
|
||||
<!ENTITY chap.view SYSTEM "chapters/view.sgml">
|
||||
<!ENTITY chap.wm SYSTEM "chapters/wm.sgml">
|
||||
<!ENTITY chap.print SYSTEM "chapters/print.sgml">
|
||||
<!ENTITY chap.compose SYSTEM "chapters/compose.sgml">
|
||||
<!ENTITY chap.converter SYSTEM "chapters/converter.sgml">
|
||||
<!ENTITY chap.mailclient SYSTEM "chapters/mailclient.sgml">
|
||||
<!ENTITY chap.net SYSTEM "chapters/net.sgml">
|
||||
<!ENTITY chap.irc SYSTEM "chapters/irc.sgml">
|
||||
<!ENTITY chap.devel SYSTEM "chapters/devel.sgml">
|
||||
<!ENTITY chap.multimedia SYSTEM "chapters/multimedia.sgml">
|
||||
<!ENTITY chap.software SYSTEM "chapters/software.sgml">
|
||||
<!ENTITY chap.outta SYSTEM "chapters/outta.sgml">
|
||||
<!ENTITY chap.other SYSTEM "chapters/other.sgml">
|
||||
<!ENTITY chap.l10n SYSTEM "chapters/l10n.sgml">
|
||||
<!ENTITY chap.faq SYSTEM "chapters/faq.sgml">
|
||||
<!ENTITY chap.charmap SYSTEM "chapters/charmap.sgml">
|
||||
<!ENTITY chap.ack SYSTEM "chapters/ack.sgml">
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.16
|
||||
-->
|
||||
|
||||
<chapter id="ack">
|
||||
<title>感謝</title>
|
||||
<para>本份文件的完成,要感謝以下的熱心人士 :-)。
|
||||
更要感謝致力為 FreeBSD 中文化的許多人們。因為他們的努力,今日
|
||||
我們在 FreeBSD 上才有舒適的中文環境能使用。
|
||||
可以從 <ulink url="http://www.freebsd.org/cgi/cvsweb.cgi/CVSROOT-ports/access">CVSROOT-ports/access</ulink> 得到所有 ports committer 的加入時間。</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>&a.statue; Weak initializer,也是新手 ports maintainer。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.clive; 給予這份文件很多的指導,
|
||||
FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/clive@freebsd.org.html">ports committer</ulink>
|
||||
(06 Dec 2000),對於中文的貢獻不遺餘力。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.foxfair; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/foxfair@freebsd.org.html">ports committer</ulink>,
|
||||
對於中文的貢獻不遺餘力。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.gslin; 提供 cvsup 的設定方式和步驟,國內使用 FreeBSD 的高級玩家。
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.ijliao; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/ijliao@freebsd.org.html">ports committer</ulink>
|
||||
(20 Jan 2001),對於中文的貢獻不遺餘力。 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.keichii; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/keichii@freebsd.org.html">src committer</ulink>(07 Mar 2001),在列印的章節給予了很多的指導。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.keith; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/keith@freebsd.org.html">ports committer</ulink>
|
||||
(06 Nov 2000),對於中文的貢獻不遺餘力。 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.kevlo; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/kevlo@freebsd.org.html">ports committer</ulink>
|
||||
(28 May 1999),對於中文的貢獻不遺餘力。 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.leeym; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/leeym@freebsd.org.html">ports committer</ulink>
|
||||
(14 Aug 2002),對於中文的貢獻不遺餘力。 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.vanilla; FreeBSD 的 <ulink url="http://people.freebsd.org/~fenner/portsurvey/vanilla@freebsd.org.html">ports committer</ulink>
|
||||
(25 Dec 1997),對於中文的貢獻不遺餘力。 </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>davidxu 是大陸的 committer,專門做 KSE 方面。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>hsu 是大陸的 committer。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>bmah 是香港的 committer。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>以下是 FreeBSD ports maintainers。</para>
|
||||
<programlisting>
|
||||
find /usr/ports -name Makefile -print|xargs grep MAINTAINER|grep \\.tw|sort|uniq|less
|
||||
cut -d\| -f6 /usr/ports/INDEX | grep \.tw\$ | sort | uniq -c</programlisting>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/avatar@mmlab.cse.yzu.edu.tw.html">avatar@mmlab.cse.yzu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/clsung@dragon2.net.html">clsung@dragon2.net</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/edwardc@firebird.org.tw.html">edwardc@firebird.org.tw.html</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/gslin@ccca.nctu.edu.tw.html">gslin@ccca.nctu.edu.tw.html</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/horance@freedom.ie.cycu.edu.tw.html">horance@freedom.ie.cycu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/jdli@csie.nctu.edu.tw.html">jdli@csie.nctu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/jihuang@gate.sinica.edu.tw.html">jihuang@gate.sinica.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/kcwu@ck.tp.edu.tw.html">kcwu@ck.tp.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/sexbear@tmu.edu.tw.html">sexbear@tmu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/piaip@csie.ntu.edu.tw.html">piaip@csie.ntu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/tung@turtle.ee.ncku.edu.tw.html">tung@turtle.ee.ncku.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/woju@freebsd.ntu.edu.tw.html">woju@freebsd.ntu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/ycheng@sinica.edu.tw.html">ycheng@sinica.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/yinjieh@csie.nctu.edu.tw.html">yinjieh@csie.nctu.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://people.freebsd.org/~fenner/portsurvey/yssu@ccca.nctu.edu.tw.html">yssu@CCCA.NCTU.edu.tw</ulink></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>以下是 GNU/Linux 相關的貢獻者。</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>&a.cwhuang; 這份文件的 GNU/Linux 版本,它是本文件的基礎。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.platin; 親手打造 GNU/Linux 中文環境原文。</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>&a.thhsieh; 親手打造 GNU/Linux 中文環境原文。</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>另外感謝台灣 ftp[1-n].tw.freebsd.org 的 mirror 站維護者,
|
||||
有了這些主機和頻寬讓我們能夠省許多到國外抓取檔案的時間,
|
||||
使得 FreeBSD 能夠快速流通於台灣。
|
||||
台灣也是全世界 mirror 站密度最高的。</para>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.18
|
||||
-->
|
||||
|
||||
<chapter id="charmap">
|
||||
<title>文字編碼</title>
|
||||
|
||||
<sect1 id="charmap-taiwan">
|
||||
<title>中文編碼</title>
|
||||
<para></para>
|
||||
<sect2 id="big5tbl">
|
||||
<title>Big5 文字內碼表</title>
|
||||
<programlisting>
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# create code table (Big5) [\0xa1-0xf9][\0x40-\0x7e\0xa1-\0xfe]
|
||||
#
|
||||
|
||||
# 繁體中文 (Big5) 文字內碼表的產生
|
||||
open (OUT, "> big5tbl.txt"); select OUT;
|
||||
|
||||
# 文字內碼表的產生
|
||||
for ($c1 = 0xA1; $c1 <= 0xF9; $c1++) { # $c1 是第一個位元 [\0xa1-\0xf9]
|
||||
|
||||
# 開頭的表示
|
||||
print "\ncode ";
|
||||
print "+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n";
|
||||
|
||||
$head = "";
|
||||
$line = "";
|
||||
$c = 1; # 1行文字數(16文字)
|
||||
|
||||
for ($c2 = 0x40; $c2 <= 0xFF; $c2++) { # $c2 是第二個位元
|
||||
|
||||
# 開頭第一個字
|
||||
if ("$head" eq "") {
|
||||
$head = sprintf ("%02X%02X ", $c1, $c2);
|
||||
}
|
||||
|
||||
# 文字的表示
|
||||
$line .= " "; # 文字間的空白
|
||||
if (($c2 == 0x7F) || ($c2 == 0xA0) || ($c2 == 0xFF)) {
|
||||
$line .= ' ';
|
||||
} else {
|
||||
$line .= pack("CC", $c1, $c2);
|
||||
}
|
||||
|
||||
if ($c == 16) { # 16文字表示一行
|
||||
print "$head$line\n";
|
||||
$head = "";
|
||||
$line = "";
|
||||
$c = 1;
|
||||
if ($c2 == 0x7F) { $c2 = 0x9F; } # 跳過 [\0x80-0x9f]
|
||||
} else {
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(OUT);
|
||||
|
||||
exit; </programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
|
@ -1,380 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.28
|
||||
-->
|
||||
|
||||
<chapter id="converter">
|
||||
<title>中文轉碼軟體</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="iconv">
|
||||
<title>iconv</title>
|
||||
<para>由於版權的問題,FreeBSD 下的 iconv 2.0 大約是 2000 年的程式,
|
||||
也就不能使用
|
||||
<ulink url="http://www.gnu.org/software/libiconv/">GNU libiconv</ulink>
|
||||
所擁有的轉換表,在使用上也是有許多缺點,建議改用
|
||||
<application>libiconv</application>。</para>
|
||||
<para>安裝 <filename role="package">converters/iconv</filename>。</para>
|
||||
<para>基本的用法有:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>biconv -f gb2312 -t big5 file.gb > file.big5</userinput></screen>
|
||||
<para>以下是寫 C 程式的小範例:</para>
|
||||
<programlisting>
|
||||
#include <stdio.h>
|
||||
#include "biconv.h"
|
||||
|
||||
void
|
||||
my_iconv(char *fromcode, char *tocode, char *inbuf, char *outbuf)
|
||||
{
|
||||
iconv_t cd;
|
||||
size_t status;
|
||||
char *inbufp, *outbufp;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
|
||||
inbytesleft = strlen(inbuf);
|
||||
outbytesleft = inbytesleft * 5;
|
||||
|
||||
cd = iconv_open(tocode, fromcode);
|
||||
if ((iconv_t) (-1) == cd) {
|
||||
perror ("Error at iconv_open");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
inbufp = inbuf;
|
||||
outbufp = outbuf;
|
||||
status = iconv (cd, &inbufp, &inbytesleft, &outbufp, &outbytesleft);
|
||||
if (status == (size_t) -1)
|
||||
{
|
||||
perror ("Error at my_iconv");
|
||||
}
|
||||
|
||||
status = iconv_close(cd);
|
||||
if (status == (int) -1)
|
||||
{
|
||||
perror ("Error at iconv_close");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
char *inbuf = "加上";
|
||||
char *outbuf = (char *) malloc(sizeof (char) * strlen(inbuf)*5);
|
||||
|
||||
my_iconv("Big5", "GBK", inbuf, outbuf);
|
||||
printf("%s -> %s\n", inbuf, outbuf);
|
||||
free(outbuf);
|
||||
}</programlisting>
|
||||
<para>以下是編譯的方式:</para>
|
||||
<programlisting>
|
||||
gcc -I/usr/local/include -L/usr/local/lib -liconv -o my_iconv my_iconv.c</programlisting>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.dante.net/staff/konstantin/FreeBSD/iconv/">
|
||||
http://www.dante.net/staff/konstantin/FreeBSD/iconv/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="libiconv">
|
||||
<title>libiconv - GNU libiconv</title>
|
||||
<para>
|
||||
<filename role="package">converters/libiconv</filename>
|
||||
是由 GNU 所發展的,功能比前述的 <application>iconv</application> 較為完備。
|
||||
</para>
|
||||
<para><application>libiconv</application>使用方法:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>iconv -f big5 -t utf8 < doc.big5 > doc.utf8</userinput>
|
||||
&prompt.user; <userinput>iconv -l</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.gnu.org/software/libiconv/">
|
||||
http://www.gnu.org/software/libiconv/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cn2jp">
|
||||
<title>cn2jp - 在中文和日文間的編碼轉移函式庫</title>
|
||||
<para>
|
||||
一個可以中文 {GB,Big5,HZ} 和日文 (EUC-Jis/Shift-Jis/Jis)
|
||||
之間互相轉換的程式。</para>
|
||||
<para>安裝 <filename role="package">converters/cn2jp</filename>。</para>
|
||||
<para>基本的用法有:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>b2j < file.big5 > file.jis</userinput>
|
||||
&prompt.user; <userinput>g2j < file.gb > file.jis</userinput>
|
||||
&prompt.user; <userinput>j2b < file.jis > file.big5</userinput>
|
||||
&prompt.user; <userinput>g2b < file.gb > file.big5</userinput>
|
||||
&prompt.user; <userinput>j2g < file.jis > file.gb</userinput>
|
||||
&prompt.user; <userinput>b2g < file.big5 > file.gb</userinput></screen>
|
||||
<para>另外還有幾個可以使用的 Library:</para>
|
||||
<programlisting>
|
||||
char *lang_big5_to_eucjis(istr)
|
||||
;translate Big5 in istr to EUC-Jis in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory big2jis
|
||||
|
||||
char *lang_gb_to_eucjis();
|
||||
;translate GB in istr to EUC-Jis in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory gb2jis
|
||||
|
||||
char *lang_eucjis_to_big5(istr)
|
||||
;translate EUC-Jis in istr to Big5 in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory jis2big
|
||||
|
||||
char *lang_gb_to_big5(istr)
|
||||
;translate GB in istr to Big5 in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory gb2big
|
||||
|
||||
char *lang_eucjis_to_gb(istr)
|
||||
;translate EUC-Jis in istr to GB in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory jis2gb
|
||||
|
||||
char *lang_big5_to_gb(istr)
|
||||
;translate Big5 in istr to GB in allocated buffer
|
||||
;the allocated buffer is returned and valid until next call
|
||||
;refer to subdirectory big2gb
|
||||
|
||||
int lang_uzpj
|
||||
;uses the uzpj system for unmappable words
|
||||
|
||||
int lang_debug
|
||||
;turns on the debug info in translation</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="autoconvert">
|
||||
<title>autoconvert - 智慧的中文編碼轉換</title>
|
||||
<para>
|
||||
<application>autoconverter</application>
|
||||
的特色是有自動判斷轉碼功能,適合用在
|
||||
GB <=> Big5 <=> HZ 互轉。</para>
|
||||
<para>安裝 <filename role="package">chinese/autoconvert</filename>。</para>
|
||||
<para>
|
||||
如果您使用 <application>procmail</application>,在
|
||||
<filename>/usr/local/share/autoconvert/procmailrc.example</filename>
|
||||
底下有一個將
|
||||
<application>autoconvert</application> 當作
|
||||
<application>procmail</application> 過濾器的範例。</para>
|
||||
<para><application>autoconvert</application>使用方法:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>autob5 -i utf8 -o big5 < shed.utf8 > shed.utf8.big5-ac</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
WWW: <ulink url="http://banyan.dlut.edu.cn/~ygh/">
|
||||
http://banyan.dlut.edu.cn/~ygh/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="c2t">
|
||||
<title>c2t - 轉譯 GB/Big5 編碼成拼音</title>
|
||||
<para>GB(大陸)/Big5(台灣)中文轉成拼音中文字轉成英文字母拼音。 </para>
|
||||
<para>安裝 <filename role="package">chinese/c2t</filename>。</para>
|
||||
<programlisting>
|
||||
&prompt.user; <userinput>echo "您好" | b2g | c2t</userinput>
|
||||
nin2 hao3</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="hc">
|
||||
<title>hc - 漢字轉換器,在 GB 和 Big5 編碼間轉換</title>
|
||||
<para>
|
||||
漢字轉換器,這是一個 BIG5 及 GB 編碼的轉換程式。 </para>
|
||||
<para>GB 與 Big5 屬於兩個不同組織各自制定的標準,
|
||||
對應漢字編碼的轉換都是通過表格來轉換,
|
||||
它們之間不存在任何內在的邏輯關係或函數。</para>
|
||||
<para>安裝 <filename role="package">chinese/hc</filename>。</para>
|
||||
<para>GB 轉為 BIG5 用:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>hc -m g2b -t /usr/local/share/chinese/hc.tab < INPUT_FILE > OUTPUT_FILE</userinput>
|
||||
</screen>
|
||||
<para>BIG5 轉為 GB 用:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>hc -m b2g -t /usr/local/share/chinese/hc.tab < INPUT_FILE > OUTPUT_FILE</userinput>
|
||||
</screen>
|
||||
<para>
|
||||
您可以自己寫一個 shell script 來簡化上面的指令。
|
||||
或是直接使用已經寫好的 shell script
|
||||
<command>g2b</command> 和 <command>b2g</command>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gb2jis">
|
||||
<title>gb2jis - GB漢字轉換JIS漢字</title>
|
||||
<para>安裝 <filename role="package">chinese/gb2jis</filename>。</para>
|
||||
<para>可輸入以下編碼:</para>
|
||||
<programlisting>
|
||||
GB2312-80 + GB8565-88
|
||||
GB2312-80
|
||||
中國語EUC (8-bit GuoBiao)
|
||||
HZ-encoding</programlisting>
|
||||
<para>可輸出以下編碼:</para>
|
||||
<programlisting>
|
||||
JISX0208-1983 + JISX0212-1990
|
||||
JISX0208-1983 + JISX0212-1990 + UZPJ
|
||||
JISX0208-1983
|
||||
JISX0208-1983 + UZPJ
|
||||
日本語EUC
|
||||
日本語EUC + UZPJ
|
||||
Shift-JIS
|
||||
Shift-JIS + UZPJ</programlisting>
|
||||
<para>UZPJ(雙拼)規則等詳細說明請參閱
|
||||
<command>man 1 gb2jis</command> 的操作指南。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="hztty">
|
||||
<title>hztty - 在 GB Big5 和 HZ tty 中轉換</title>
|
||||
<para>
|
||||
<application>Hztty</application> 可在不同中文編碼格式做轉換。
|
||||
可轉換國標(GB)/繁體(Big5)/漢字(HZ)標(GB)就是大陸用的簡體字,
|
||||
繁體(Big5)是台灣用的,漢字(HZ)是其它地區用的,
|
||||
各地區有不同的中文編碼,有了此程式讓不同地區間的中文溝通更順暢。</para>
|
||||
<para>安裝 <filename role="package">chinese/hztty</filename>。</para>
|
||||
<para>
|
||||
用法很簡單,如果您要在 Big5 的環境底下連上 GB 的
|
||||
BBS,只要依照以下的步驟:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>hztty -I big2gb -O gb2big</userinput>
|
||||
[hztty started] [using /dev/ttyp3]
|
||||
&prompt.user; <userinput>telnet bbs.tsinghua.edu.cn</userinput>
|
||||
&prompt.user; <userinput>exit</userinput>
|
||||
exit
|
||||
|
||||
[hztty exited]</screen>
|
||||
<para>
|
||||
這樣子就可以輸出自動將簡體轉為繁體,並將輸入自動由繁體轉為簡體,
|
||||
就可以很方便的與使用簡體的人溝通了。</para>
|
||||
<para>
|
||||
bbs.tsinghua.edu.cn(水木清華) 有 FreeBSD 的討論版。</para>
|
||||
<figure>
|
||||
<title>hztty snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/hztty" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="jis2gb">
|
||||
<title>jis2gb - JIS漢字轉換GB漢字</title>
|
||||
<para>安裝 <filename role="package">chinese/jis2gb</filename>。</para>
|
||||
<para>可輸入以下編碼:</para>
|
||||
<programlisting>
|
||||
JISX0208-1983 (JISC6226-1978)
|
||||
JISX0212-1990
|
||||
日本語EUC
|
||||
Shift-JIS</programlisting>
|
||||
<para>可輸出以下編碼:</para>
|
||||
<programlisting>
|
||||
GB2312-80 + GB8565-88
|
||||
GB2312-80
|
||||
中國語EUC (8-bit GuoBiao)
|
||||
HZ-encoding</programlisting>
|
||||
<para>詳細說明請參閱
|
||||
<command>man 1 jis2gb</command> 的操作指南。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="pycodec">
|
||||
<title>pycodec - 中文碼/萬國碼轉換程式</title>
|
||||
<para>
|
||||
這個套件支援Python和C兩種介面,可轉換中文碼和萬國碼(Unicode)。
|
||||
如果您只用Python寫程式,請採用Python介面。
|
||||
然而,如果您喜歡C,可以試著使用C介面。
|
||||
C介面是用Python/C API寫出來的,目的是為了得到較佳的效能。
|
||||
就目前而言,Python介面適用GNU/Linux和Windows系統,
|
||||
但是,這一版的C介面只能用於GNU/Linux系統。</para>
|
||||
<para>安裝 <filename role="package">converters/py-cjkcodecs</filename>。</para>
|
||||
<para>在demo/子目錄下,您可以找到test_*.py;
|
||||
這是用來示範如何把中文碼轉換成Unicode,
|
||||
或者從Unicode轉換成中文碼。</para>
|
||||
<para>
|
||||
在chinesetw/子目錄下,有四個對照表檔案,如下所示:</para>
|
||||
<programlisting>
|
||||
o big52utf1.py
|
||||
o big52utf2.py
|
||||
o utf2big51.py
|
||||
o utf2big52.py</programlisting>
|
||||
<para>
|
||||
主檔名中最後一個數字是指BIG5碼的層級,如big52utf1.py指的就是第一層
|
||||
BIG5碼,而big52utf2.py指的就是第二層BIG5碼。
|
||||
由於第一層BIG5碼定義的都是最常用的中文字,
|
||||
因此,把第一層和第二層分開,多少有助於加快辭典的搜尋速度。</para>
|
||||
<para>
|
||||
此外,倚天版的Big5或是Big5 Plus並不保證能正常運作。</para>
|
||||
<para>
|
||||
C介面:每個共享模組中只有兩個方函:decode()和encode()。
|
||||
您可以把BIG5字串轉成萬國碼字串,也可以直接轉成UTF-8或UTF-16。
|
||||
最原始的用法,請參見範例。</para>
|
||||
<programlisting>
|
||||
#!/usr/local/bin/python
|
||||
twstring = "這是一個測試, 英文是\"This is a test.\"\n" + \
|
||||
"先把BIG5碼轉換成Unicode, 再把Unicode轉\n" + \
|
||||
"回BIG5碼. 效果還不錯, 但效能差一點."
|
||||
uni = unicode(twstring, "big5_tw")
|
||||
bstring = uni.encode("big5_tw")
|
||||
print "Original BGI5 encoded string:"
|
||||
print twstring
|
||||
print "Transcode to Unicode encoding:"
|
||||
print repr(uni)
|
||||
print "Print as a BIG5 encoded string:"
|
||||
print bstring</programlisting>
|
||||
<para>
|
||||
WWW: <ulink url="http://sourceforge.net/projects/python-codecs/">
|
||||
http://sourceforge.net/projects/python-codecs/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="fzzdxfw">
|
||||
<title>fzzdxfw - 方正中等線繁體</title>
|
||||
<para>Contributed by 逸晨 (weonfu@hotmail.com)</para>
|
||||
<para>Last Update: 2003年 4月 6日 周日 15時43分29秒 CST</para>
|
||||
<para>把簡體網站直接變繁體的方式目前有不少種,
|
||||
使用南極星的軟體,使用中介型網站例如
|
||||
<ulink url="http://chinagate.yam.com/">
|
||||
番薯藤的簡體網頁繁體化</ulink>,
|
||||
另ㄧ種就是直接從字型下手。
|
||||
在這邊提供從字型下手的方式。</para>
|
||||
<para><application>fzzdxfw</application> 字型的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/fzzdxfw</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
<para>安裝完後,可以用 ttfm.sh --list xttfm 來查看是否有裝好。</para>
|
||||
<programlisting>
|
||||
FZZDXFW.TTF -misc-FZZhongDengXian_Z07T-medium-r-normal--0-0-0-0-c-0-gb2312.1980-0
|
||||
FZZDXFW.TTF -misc-FZZhongDengXian_Z07T-medium-r-normal--0-0-0-0-p-0-iso8859-1
|
||||
FZZDXFW.TTF -misc-FZZhongDengXian_Z07T-medium-r-normal--0-0-0-0-c-0-iso10646-1</programlisting>
|
||||
<para>確認後,設定 Mozilla 的字型配置,
|
||||
繁體字型與歐美字型的部分保持原設定,
|
||||
只需要修改簡體字型的部分。</para>
|
||||
<para>如果是 IE 的使用者可以將字型安裝到
|
||||
<filename>C:/WINDOWS/Fonts</filename> 之下,
|
||||
然後開啟 IE,<option>工具 -> 網際網路選項 -> ㄧ般 ->
|
||||
字型 -> 字集: 簡體中文 -> 網頁字型: FZZhongDengXian-Z07T ->
|
||||
純文字字型: FZZhongDengXian-Z07T</option>,
|
||||
並且修改 <option>工具 -> 網際網路選項 -> ㄧ般 ->
|
||||
存取設定 -> 略過Wab網頁上指定字型樣式</option>
|
||||
勾起來,可以防止網頁直接寫死字型。</para>
|
||||
<figure>
|
||||
<title>fzzdxfw snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/fzzdxfw" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>DL: <ulink url="http://dl1.51soft.com:8080/51fonts/cnfont/fangzheng/fzzdxfw.zip">
|
||||
方正中等線繁體下載位址</ulink></para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
|
@ -1,985 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.53
|
||||
-->
|
||||
|
||||
<chapter id="devel">
|
||||
<title>中文程式設計</title>
|
||||
<para>
|
||||
以下是一些軟體在中文支援方面,利用程式的判斷。</para>
|
||||
<para>
|
||||
原則上如果是用 gtk 寫的軟體,裡面有呼叫到 gtk_set_locale()
|
||||
這個函式的話應該都沒問題。</para>
|
||||
<para>
|
||||
如果是其他的 X 軟體可能要找一下 source 裡面有沒有
|
||||
setlocale(LC_CTYPE, NULL);
|
||||
及 XIM 相關函式呼叫情形。如果有遵照正統做法,
|
||||
<application>xcin2.5</application> 應該都可以跟它搭配良好。</para>
|
||||
<para>
|
||||
Qt 沒碰過,所以不知道他怎麼運作。不過猜想 XIM 這段應該跟
|
||||
gtk 大同小異。</para>
|
||||
<para>
|
||||
用 xforms 寫的軟體應該會有問題。</para>
|
||||
<para>
|
||||
用 X11R6.4 版以後的 Xt/Xaw 寫的軟體應該是沒問題,
|
||||
記得在 .Xdefaults 裡頭加入 <option>*international:true</option>
|
||||
、<option>*fontSet:-*-iso8859-1,-*-16-*-big5-0</option>
|
||||
等等。</para>
|
||||
<para>用 fltk 寫的軟體似乎也沒支援 XIM。</para>
|
||||
|
||||
<sect1 id="freebsd-prog">
|
||||
<title>在 FreeBSD 下寫程式應該注意的問題</title>
|
||||
<para>
|
||||
在FreeBSD下寫程式,結果發現一個中文的問題,
|
||||
例如字串中包含這"許"這個字,因為許字的下半碼是
|
||||
ascii中的\符號,結果就會造成錯誤,請問這種情形
|
||||
應該如何解決?又還有沒有其他的碼有這種問題?</para>
|
||||
<para>在程式中該字前加一個 '\',還有很多有這個問題呢,如下:</para>
|
||||
<programlisting>
|
||||
5C +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
|
||||
A0 ﹏ 兝 α 么 功 吒 吭 沔 坼 歿 俞 枯 苒 娉 珮
|
||||
B0 豹 崤 淚 許 廄 琵 跚 愧 稞 鈾 暝 蓋 墦 穀 閱 璞
|
||||
C0 餐 縷 擺 黠 孀 髏 躡 ふ ж 尐 佢 汻 岤 狖 垥 柦
|
||||
D0 胐 娖 涂 罡 偅 惝 牾 莍 傜 揊 焮 茻 鄃 幋 滜 綅
|
||||
E0 赨 塿 槙 箤 踊 嫹 潿 蔌 醆 嬞 獦 螏 餤 燡 螰 駹
|
||||
F0 礒 鎪 瀙 酀 瀵 騱 酅 贕 鱋 鱭 </programlisting>
|
||||
<para> '\' 的 ASCII code 是 \0x5c,從 [\0xa1-\0xf9][\0x5c]
|
||||
都會有這個問題。</para>
|
||||
<programlisting>
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# create code table (Big5) [\0xa1-0xf9][\0x40-\0x7e\0xa1-\0xfe]
|
||||
#
|
||||
|
||||
# 繁體中文 (Big5) 文字內碼表的產生
|
||||
open (OUT, "> big55c.txt"); select OUT;
|
||||
|
||||
# 文字內碼表的產生
|
||||
# 開頭的表示
|
||||
print "\n5C ";
|
||||
print "+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n";
|
||||
$c = 1; # 1行文字數(16文字)
|
||||
$head = "";
|
||||
$line = "";
|
||||
for ($c1 = 0xA0; $c1 i<= 0xF9; $c1++) { # $c1 是第一個位元 [\0xa1-\0xf9]
|
||||
$c2=0x5c;
|
||||
# 開頭第一個字
|
||||
if ("$head" eq "") {
|
||||
$head = sprintf ("%02X ", $c1);
|
||||
}
|
||||
|
||||
$line .= " "; # 文字間的空白
|
||||
if ($c1 == 0xA0) {
|
||||
$line .= " ";
|
||||
} else {
|
||||
$line .= pack("CC", $c1, $c2);
|
||||
}
|
||||
|
||||
if ($c == 16 || $c1 ==0xf9) { # 16文字表示一行
|
||||
print "$head$line\n";
|
||||
$head = "";
|
||||
$line = "";
|
||||
$c = 1;
|
||||
} else {
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
close(OUT);
|
||||
|
||||
exit;</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="jsp-servlet">
|
||||
<title>JSP / Servlet 怎樣才能處理中文?</title>
|
||||
<para>
|
||||
鄭原真 &a.ycheng; Copyright 2000.</para>
|
||||
<para>
|
||||
本文版權 : GPL or BSD style,請保留作者姓名。</para>
|
||||
<para>
|
||||
本文假設您已經會使用 JSP 或是 Servlet 撰寫英文的 Web-Page。
|
||||
如果您還不會,或是根本不知道 JSP 或是 Servlet 是幹什麼的,
|
||||
那這篇文章不是寫給您看的。</para>
|
||||
<para>
|
||||
在 Java Servlet Spec v2.0 中,對於多國語言的支援,並不足。
|
||||
您必須找到 Java Servlet Spec v2.2 的實作才行,筆者試過的
|
||||
是 Apache Jakarta Tomcat 3.1 軟體(註一)。</para>
|
||||
<para>
|
||||
本文測試平台是 Debian Woody, Sun jdk1.2.2, Tomcat 3.1,
|
||||
mm.mysql-2.0.2</para>
|
||||
<para>Java Server 如何處理中文。</para>
|
||||
<para>前言</para>
|
||||
<para>
|
||||
首先,如何正確的了解您一個 Big5 中文在 Java 中是正確的
|
||||
中文 Unicode 呢?</para>
|
||||
<para>
|
||||
輸出一個 String("今").length() 吧 ! 由於 "今" 在 Big5 是由兩個
|
||||
byte 組成,但對 java 來說,java 的字元是 unicode,也就是說,
|
||||
無論是一個英文字或是一個中文字,其 length() 都是 1. 也就是說,
|
||||
(new String("今")).length() ==> 1。才是正確的。</para>
|
||||
<para>Servlet 輸出中文的一個例子。</para>
|
||||
<para>下面是一個典型的 Java Servlet。</para>
|
||||
<programlisting>
|
||||
HelloWorldExample.java =>
|
||||
----------- cut here -----------------
|
||||
import java.io.*;
|
||||
import java.text.*;
|
||||
import java.util.*;
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
|
||||
public class HelloWorldExample extends HttpServlet {
|
||||
|
||||
public void doGet(HttpServletRequest request,
|
||||
HttpServletResponse response)
|
||||
throws IOException, ServletException
|
||||
{
|
||||
response.setLocale(new Locale(new String("zh"), new String("TW")));
|
||||
response.setContentType("text/html");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
out.println("<html>");
|
||||
out.println("<head>");
|
||||
|
||||
String title = new String("hello 大家好");
|
||||
|
||||
out.println("<title>" + title + "</title>");
|
||||
out.println("</head>");
|
||||
out.println("<body bgcolor=\"white\">");
|
||||
out.println("<body>");
|
||||
|
||||
out.println("<p>");
|
||||
|
||||
out.println("<h1>" + title + "</h1>");
|
||||
out.println("</body>");
|
||||
out.println("</html>");
|
||||
}
|
||||
}
|
||||
----------- cut here -----------------</programlisting>
|
||||
<para>可以正常輸出中文的關鍵是:</para>
|
||||
<programlisting>
|
||||
response.setLocale(new Locale(new String("zh"), new String("TW")));</programlisting>
|
||||
<para>注意這一行應該要放在</para>
|
||||
<programlisting>
|
||||
PrintWriter out = response.getWriter();</programlisting>
|
||||
<para>之前執行。另外編譯時注意</para>
|
||||
<programlisting>
|
||||
javac -encoding Big5 HelloWorldExample.java</programlisting>
|
||||
<para>或是 (linux 上的 jdk1.2.2)</para>
|
||||
<programlisting>
|
||||
export LANG=zh_TW.Big5
|
||||
export LC_CTYPE=zh_TW.Big5
|
||||
javac HelloWorldExample.java</programlisting>
|
||||
<para>
|
||||
注意,這個例子在 jserv v1.1.2 並不能 work,因為該版本實做的
|
||||
JavaSoft Java Servlet APIs 2.0, 而 setLocale 是到
|
||||
Servlet APIs 2.2 才有。</para>
|
||||
<para>Java Server Page 如何處理中文</para>
|
||||
<para>在此簡略說明,先看下面的例子:</para>
|
||||
<programlisting>
|
||||
test.jsp
|
||||
----------------------
|
||||
<%@ page contentType="text/html; charset=big5" %>
|
||||
<html>
|
||||
<body bgcolor="white">
|
||||
中文TEST.<p>
|
||||
<%= (new String("今天")).length() %>
|
||||
out.println("大家好");
|
||||
</body>
|
||||
</html>
|
||||
----------------------</programlisting>
|
||||
<para>關鍵在第一行。有了這一行就行了。</para>
|
||||
<para>而如果使用 POST 時,要使用中文就先看下面的例子</para>
|
||||
<programlisting>
|
||||
test2.jsp
|
||||
----------------------
|
||||
<html>
|
||||
<head>
|
||||
<title>Instropection</title>
|
||||
</head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=big5">
|
||||
<body>
|
||||
<body bgcolor="#FFFFFF" text="#000000">
|
||||
<form name="form1" action="test3.jsp" method="post" >
|
||||
<p> 姓名:
|
||||
<input type="text" name="name">
|
||||
</p>
|
||||
<p>編號:
|
||||
<input type="text" name="number">
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="傳送">
|
||||
<input type="reset" value="清除">
|
||||
</p>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
----------------------
|
||||
|
||||
test3.jsp
|
||||
----------------------
|
||||
<%@ page language="java" contentType="text/html;charset=Big5" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Instropection</title>
|
||||
</head>
|
||||
<body>
|
||||
<%
|
||||
String name = new String(request.getParameter("name").getBytes("ISO-8859-1"), "Big5");
|
||||
String number = request.getParameter("number");
|
||||
%>
|
||||
姓名:<%= name %>
|
||||
<br>編號:<%= number %>
|
||||
</body>
|
||||
</html>
|
||||
----------------------</programlisting>
|
||||
<para>
|
||||
關鍵在於 String(str.getBytes("ISO-8859-1"), "Big5"),
|
||||
java.lang.String 的建構函式可以產生指定特定語系的 String,
|
||||
透過這個範例,可以使 String 正確地轉換中文。</para>
|
||||
<para>For Hacker:</para>
|
||||
<para>
|
||||
理論上這一行可以放在文件的任何地方,但由於 Java 時做上
|
||||
開檔案後通常就必須指定 encoding,當 java jsp engine 發現
|
||||
charset 跟 default 不同時,通常必須重新開檔案。所以實做上
|
||||
這一行放在越前面越好。不過話是這樣說,由於通常 jsp 會在
|
||||
run time 被 compile 成 java bytecode,也就是說只有在
|
||||
.jsp 更新時才需要 recompile。overhead 實在有限。</para>
|
||||
<para>
|
||||
註一:請到 http://jakarta.apache.org/ 下去 Download。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="java-mysql">
|
||||
<title>Java 連結到 MySql 如何使用中文?</title>
|
||||
<para>鄭原真 &a.ycheng; Copyright 2000.</para>
|
||||
<para>本文版權 : GPL or BSD style,請保留作者姓名。</para>
|
||||
<para>
|
||||
本文假設您已經會使用 JSP 或是 Servlet 撰寫英文的 Web-Page。
|
||||
如果您還不會,或是根本不知道 JSP 或是 Servlet 是幹什麼的,
|
||||
那這篇文章不是寫給您看的。</para>
|
||||
<para>
|
||||
在 Java Servlet Spec v2.0 中,對於多國語言的支援,並不足。
|
||||
您必須找到 Java Servlet Spec v2.2 的實作才行,筆者試過的
|
||||
是 Apache Jakarta Tomcat 3.1 軟體(註一)。</para>
|
||||
<para>
|
||||
本文測試平台是 Debian Woody, Sun jdk1.2.2, Tomcat 3.1,
|
||||
mm.mysql-2.0.2</para>
|
||||
<para>
|
||||
Java 以 jdbc 連結到 databases server,MySql 有 Free 的
|
||||
jdbc driver。以下不擬說明如何使用 jdbc,僅說明如何修改
|
||||
您的 code 使可以用中文。</para>
|
||||
<para>
|
||||
mysql 儲存中文資料有兩種方法,第一種是使用 big5 內碼儲存,
|
||||
其優點是節省硬碟/記憶體空間,相較於使用 UTF8 之下,若輸出
|
||||
為 Big5,更省去一次的 Unicode (UTF8) 與 Big5 需要經過
|
||||
Table lookup 的轉換。但使用 Big5 就會有 Big5 先天上的問題。
|
||||
典型的問題是 Big5 字串在處理字的邊界的問題。Big5 先天上的
|
||||
問題是這樣的,就以 "問題" 這個字串為例,問字的第二個 byte
|
||||
跟題字的第一個 byte 所形成的字是 "暋" 字。所以當我們在作
|
||||
文字搜尋找包含 "暋" 的字串,我們會連包含 "問題" 的字串也
|
||||
一起找到。但 UTF8 內碼在設計上就避開了這個問題, 犧牲的是
|
||||
必須用較多的 byte (octets) 表示。</para>
|
||||
<para>
|
||||
我只有試過 MySql 內的 Data 用 UTF8,Big5 沒試過。要注意的
|
||||
是,在 UTF8 中,中文的長度是 3 個 bytes,由於 MySQL 固定
|
||||
字串欄位送進過長的資料時,會發生過長處被截斷。但 MySql 不懂
|
||||
UTF8,所以可能發生一個 UTF8 字元第二 or 三個 byte 被截掉
|
||||
問題,在 ASCII 中問題不大,頂多出現一個 "I Love Yo","u" 不
|
||||
見了。但在 java 把資料讀進來,把 UTF8 轉成 java 內部的表示
|
||||
法時,就會發生有些 Byte 無法轉成功的問題,應該會造成
|
||||
Exception。(註二)</para>
|
||||
<para>
|
||||
好,回來,在 jdbc 中,並沒有規範在 Database 中的字元的內碼,
|
||||
而把這個問題留給各個 jdbc driver 處理。mysql jdbc driver
|
||||
要在 database 中設為 utf8 的設定方式如下:</para>
|
||||
<programlisting>
|
||||
Properties pr;
|
||||
Connection db;
|
||||
|
||||
pr = new Properties();
|
||||
pr.put("characterEncoding", "UTF8");
|
||||
pr.put("useUnicode", "TRUE");
|
||||
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
|
||||
db = DriverManager.getConnection("jdbc:mysql:///test", pr);</programlisting>
|
||||
<para>
|
||||
其餘請自行參考一般 jdbc 程式寫作的資料。當然, compile 此
|
||||
Servlet 時需要在呼叫 javac 時加上 "-encoding Big5"。</para>
|
||||
<para>
|
||||
若要使用 Big5 的話, 上面 "UTF8" 改成 "Big5" 即可。但這樣作會
|
||||
出現另一個問題, 就是中文第二個 byte 有 '\' 的問題。這個問題我
|
||||
不知道有沒有方便的解法,不知道 compile mysql 時將 encoding 設
|
||||
為 big5 可否解決這個問題。(註二)</para>
|
||||
<para>
|
||||
註二:這個我沒有測試過,誰要測了跟大家說結果的?</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="linux-gtk">
|
||||
<title>linux-gtk - gtk-1.2.6 的函式庫 rpm,有 Big5/GB 的支援</title>
|
||||
<para>
|
||||
以下是比 x11-toolkits/linux-gtk 更好的 I18N 的優點。</para>
|
||||
<programlisting>
|
||||
Better word wrapping for CJK strings
|
||||
Specify default font's encoding explicitly
|
||||
Better XLFD handling
|
||||
Selection resync fixes
|
||||
Numerous gtkrc.$locale samples
|
||||
Other minor fixes</programlisting>
|
||||
<para>安裝 <filename role="package">chinese/linux-gtk</filename>。</para>
|
||||
<para>
|
||||
唯一的缺點是這個套件是 CLE 用來給 i386 平台所使用的,
|
||||
所以如果是 alpha 的使用者的話仍需使用 x11-toolkits/linux-gtk。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="php-ImageTTFText">
|
||||
<title>php 的 ImageTTFText() 經常抓錯字?</title>
|
||||
<para>Contributed by &a.jerry;</para>
|
||||
<para>Last Update: 2003年 4月29日 周二 19時43分15秒 CST</para>
|
||||
<para>在安裝 <filename role="package">www/mod_php4</filename>
|
||||
時必須選擇 GD library support 及 freetype 的套件才能進行下面的步驟。</para>
|
||||
<para>目前常見的有三種做法,一種是 patch gdttf.c,
|
||||
一種是使用 iconv support 來將編碼轉成 UCS-2 ,
|
||||
還有一種就是直接使用 <filename role="package">chinese/hc</filename>
|
||||
的資料庫。</para>
|
||||
<para>這邊是第一種做法,patch gdttf.c 讓 PHP 不會抓錯字。</para>
|
||||
<programlisting>
|
||||
--- gdttf.c.orig Mon Oct 16 21:55:47 2000
|
||||
+++ gdttf.c Sun Dec 31 18:00:34 2000
|
||||
@@ -654,7 +654,7 @@
|
||||
TT_BBox **bbox,
|
||||
char **next)
|
||||
{
|
||||
- int pc, ch, len;
|
||||
+ int pc, ch, len, ch2;
|
||||
int row, col;
|
||||
int x2, y2; /* char start pos in pixels */
|
||||
int x3, y3; /* current pixel pos */
|
||||
@@ -687,6 +687,8 @@
|
||||
(*next)++;
|
||||
if (ch >= 161 /* first code of JIS-8 pair */
|
||||
&& **next) { /* don't advance past '\0' */
|
||||
+ ch2 = (**next) & 255;
|
||||
+ if(ch2 >= 161) ch++; /* Big5 ttf patch */
|
||||
ch = (ch * 256) + **next;
|
||||
(*next)++;
|
||||
}</programlisting>
|
||||
<para>由於已經處理過 gdttf.c,在這邊就可以直接使用中文編碼的字。</para>
|
||||
<programlisting>
|
||||
<?php
|
||||
Header ("Content-type: image/gif");
|
||||
$im = imagecreate (400, 30);
|
||||
$black = ImageColorAllocate ($im, 0, 0, 0);
|
||||
$white = ImageColorAllocate ($im, 255, 255, 255);
|
||||
ImageTTFText ($im, 20, 0, 10, 20, $white,
|
||||
"/usr/X11R6/lib/X11/fonts/TrueType/moe_kai.ttf", "這是中文測試 許功蓋 ");
|
||||
ImagePng ($im);
|
||||
ImageDestroy ($im);
|
||||
?></programlisting>
|
||||
<para>
|
||||
第二種是使用 unicode 讓中文正常的顯示,
|
||||
以下就是 big5 轉 unicode 的做法,
|
||||
在這邊提供一個小函式來自動判斷為英文還是中文,
|
||||
英文的部分不需要轉碼,只有中文才需要。</para>
|
||||
<programlisting>
|
||||
<?php
|
||||
/* need iconv module */
|
||||
function big52uni($text) {
|
||||
$rtext="";
|
||||
$max=strlen($text);
|
||||
for($i=0;$i<$max;$i++){
|
||||
$h=ord($text[$i]);
|
||||
if($h>=160 && $i<$max-1){
|
||||
$rtext.="&#".base_convert(bin2hex(iconv("big5","ucs-2",
|
||||
substr($text,$i,2))),16,10).";";
|
||||
$i++;
|
||||
}else{
|
||||
$rtext.=$text[$i];
|
||||
}
|
||||
}
|
||||
return $rtext;
|
||||
}
|
||||
?></programlisting>
|
||||
<para>用法的範例如下,在 ImageTTFText 必須指定系統上的字型,
|
||||
以下是安裝 <filename role="package">chinese/arphicttf</filename>
|
||||
來使用文鼎PL上海宋,所以必須根據自己的安裝的字型作修改,
|
||||
然後搭配上面的 big52uni 這個函式:</para>
|
||||
<programlisting>
|
||||
<?php
|
||||
Header("Content-type: image/gif");
|
||||
$im = imagecreate(400,30);
|
||||
$black = ImageColorAllocate($im, 0,0,0);
|
||||
$white = ImageColorAllocate($im, 255,255,255);
|
||||
ImageTTFText($im, 20, 0, 10, 20, $white,
|
||||
"/usr/local/share/fonts/TrueType/bsmi00lp.ttf",
|
||||
big52uni("Test中文測試"));
|
||||
ImageGif($im);
|
||||
ImageDestroy($im);
|
||||
?></programlisting>
|
||||
<figure>
|
||||
<title>php-imagettftext snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/php-imagettftext" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.php.net/">
|
||||
http://www.php.net/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="php-upload">
|
||||
<title>php 上傳中文檔名的檔案</title>
|
||||
<para>by Wiseguy.bbs@bbs.nsysu.edu.tw</para>
|
||||
<para>
|
||||
另開一個 <input type="hidden" name="filename">
|
||||
在 submit 前,把 file 裡的檔名取出來 (用 split('\\'),陣列最後一個。)
|
||||
放到 filename 去,這樣就可知道原檔名是什麼,而不用 file 裡面處理的檔名。
|
||||
這種作法可以使中文檔名、含空白、管道字元 | 、反斜線,通通可上傳。</para>
|
||||
<programlisting>
|
||||
<?php
|
||||
if($_FILES['userfile']['name']) {
|
||||
echo $_POST['fname'];
|
||||
} else {
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
function validate() {
|
||||
var Ary = document.uploadf.userfile.value.split('\\');
|
||||
document.uploadf.fname.value=Ary[Ary.length-1];
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<form enctype="multipart/form-data" action="index.php" method="post"
|
||||
name="uploadf" onsubmit="return validate()">
|
||||
Send this file: <input name="userfile" type="file">
|
||||
<input type="hidden" name="fname">
|
||||
<input type="submit" value="Send File">
|
||||
</form>
|
||||
<?php } ?>
|
||||
</programlisting>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.php.net/manual/en/features.file-upload.php">
|
||||
http://www.php.net/manual/en/features.file-upload.php</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="php-pdf">
|
||||
<title>用 php 製作中文 PDF 檔</title>
|
||||
<para>Contributed by Tim (tim@dnes.mlc.edu.tw)</para>
|
||||
<para>Last Update: 2003年 4月20日 周日 15時59分41秒 CST</para>
|
||||
<para>php 目前可以使用 PDFlib 來建立不內嵌字型的 PDF 檔,
|
||||
|
||||
在 pdf_findfont 的部分要給對字型就可以了。</para>
|
||||
<programlisting>
|
||||
$font = pdf_findfont($pdf, 'MSung-Light', 'ETen-B5-H', 0); </programlisting>
|
||||
<para>以下是完整範例,記得要先在該目錄底下建立 hello.pdf
|
||||
並且將權限改成 666。</para>
|
||||
<programlisting>
|
||||
<?php
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=big5">';
|
||||
//create file
|
||||
$fp = fopen('hello.pdf', 'w');
|
||||
if(!$fp)
|
||||
{
|
||||
echo "Error: could not create the PDF file";
|
||||
exit;
|
||||
}
|
||||
|
||||
// start the pdf document
|
||||
$pdf = pdf_open($fp);
|
||||
pdf_set_info($pdf, "Creator", "pdftest.php");
|
||||
pdf_set_info($pdf, "Author", "Shen Chun-Hsing");
|
||||
pdf_set_info($pdf, "Title", "Hello World (PHP)");
|
||||
|
||||
// US letter is 11" x 8.5" and there are approximately 72 points per inch
|
||||
pdf_begin_page($pdf, 8.5*72, 11*72/2);
|
||||
pdf_add_outline($pdf, 'Page 1');
|
||||
|
||||
// 取得字型
|
||||
$Efont = pdf_findfont($pdf, 'Times-Roman', 'host', 0);
|
||||
$Cfont = pdf_findfont($pdf, 'MSung-Light', 'ETen-B5-H', 0);
|
||||
|
||||
// write text
|
||||
pdf_setfont($pdf, $Efont, 24);
|
||||
pdf_set_text_pos($pdf, 50, 700/2);
|
||||
pdf_show($pdf,'Hello world!');
|
||||
pdf_continue_text($pdf,'(says PHP)');
|
||||
pdf_setfont($pdf, $Cfont, 24);
|
||||
pdf_continue_text($pdf,'細明體中文字測試');
|
||||
|
||||
// end the document
|
||||
pdf_end_page($pdf);
|
||||
pdf_close($pdf);
|
||||
fclose($fp);
|
||||
|
||||
// display a link to download
|
||||
echo "<a href = 'hello.pdf' target='_blank'>測試檔PDF</a>";
|
||||
echo "<hr>";
|
||||
show_source( basename( getenv("SCRIPT_FILENAME") ) );
|
||||
?></programlisting>
|
||||
|
||||
<para>在 pdf_findfont 的部分選擇 ('MSung-Light', 'ETen-B5-H')
|
||||
這樣子的 CID-Keyed font 就可以使用明體了,
|
||||
第一個欄位還可以換成 MHei-Medium 來使用楷體,
|
||||
不過在目前的支援度下,所能看到的不管設定明體或是楷體,
|
||||
都只會有明體而以,
|
||||
這必須是 PDF 瀏覽器支援設定的字體有其相對應的字體才行,
|
||||
而第二個欄位 CMap 基本上建議使用 ETen-B5-H 才能使用倚天外字。</para>
|
||||
<para>可以用的英文字型如下:
|
||||
Courier Courier-Bold Courier-Oblique Courier-BoldOblique Helvetica
|
||||
Helvetica-Bold Helvetica-Oblique Helvetica-BoldOblique Symbol
|
||||
Times-Roman Times-Bold Times-Italic Times-BoldItalic ZapfDingbats。</para>
|
||||
<para>可以用的中文 CMap 如下:
|
||||
B5pc-H B5pc-V HKscs-B5-H HKscs-B5-V ETen-B5-H ETen-B5-V ETenms-B5-H
|
||||
ETenms-B5-V CNS-EUC-H CNS-EUC-V UniCNS-UCS2-H UniCNS-UCS2-V。</para>
|
||||
<figure>
|
||||
<title>php-pdf snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/php-pdf" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>而 pdf_add_bookmark 有人說有中文的問題,可是在筆者的測試之下,
|
||||
Big5 編碼的 bookmark 在 Acroread 5 可以正常看到,或是利用
|
||||
iconv 轉成 UTF-16 也是正常的,所以如果您看到的 bookmark 有中文問題,
|
||||
可以利用 iconv("Big5", "UTF-16", "中文字") 來試試看。</para>
|
||||
<para>WWW: <ulink url="http://www.PDFlib.com/">
|
||||
http://www.PDFlib.com/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tcltk">
|
||||
<title>Tcl/Tk - 廣為運用的一種高階電腦語言與 GUI 發展工具</title>
|
||||
<para>
|
||||
tcl 是一個高階的電腦語言,語法類似 shell script 與 C 語言之間。而
|
||||
tk 是一個使用者界面發展工具,有 buttons、menus、listboxes、
|
||||
scrollbars 等等。</para>
|
||||
<para>
|
||||
把這兩者結合起來,就形成了強有力的 GUI 發展套件。最新版本的
|
||||
tcl/tk 支援了多平台的開發程式庫。所以我們可以寫一個 tcl/tk
|
||||
的程式(也稱為script),然後在 UNIX 下看起來就像是 Motif
|
||||
的應用程式;在 Windows9x/NT 下看起來像是 Win32 的應用程式;而在
|
||||
Macintosh 下看起來像 Mac 的應用程式。</para>
|
||||
<para>
|
||||
tcl/tk 的優點第一是 free(自由)。
|
||||
第二是容易學習,您不須具備 object-oriented 或 threads 或
|
||||
Microsoft Fundation Classes 的基礎,也不須寫一大串的程式碼。
|
||||
像是傳統的 Hello, World! 程式,在 tcl/tk 只要兩行就搞定,</para>
|
||||
<programlisting>
|
||||
button .b -text "Hello, World!" -command exit
|
||||
pack .b</programlisting>
|
||||
<para>
|
||||
第三是有許多的 extensions(延伸套件)可以支援其他軟體程式庫,
|
||||
例如 Oracle, Sybase, Informix, OpenGL 等多達 400 種。</para>
|
||||
<para>安裝 <filename role="package">chinese/tcl83</filename> 與
|
||||
<filename role="package">chinese/tk83</filename>。</para>
|
||||
<para>
|
||||
chinese/tcl83 和 chinese/tk83 主要是補上一個
|
||||
<option>--enable-i18nImprove</option> 的選項,
|
||||
修正 XIM 處理有問題的部份。</para>
|
||||
<para>中文顯示都正常,中文輸入也是正常的。</para>
|
||||
<programlisting>
|
||||
#!/usr/local/bin/wish8.3
|
||||
tk useinputmethods 1
|
||||
font create bsmilpfont -family "ar pl mingti2l big5" -size 16
|
||||
label .a -text "標籤" -font bsmilpfont
|
||||
pack .a
|
||||
button .b -text "按鈕" -command { puts stdout $cc; exit } -font bsmilpfont
|
||||
pack .b
|
||||
entry .c -textvariable cc -font bsmilpfont
|
||||
pack .c</programlisting>
|
||||
<figure>
|
||||
<title>tcltk snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/tcltk" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para> WWW: <ulink url="http://www.scriptics.com/software/tcltk/8.3.html">
|
||||
http://www.scriptics.com/software/tcltk/8.3.html</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="postgre">
|
||||
<title>PostgreSQL 不能處理中文?</title>
|
||||
<para>
|
||||
<application>PostgreSQL</application> 中使用中文一向有小問題,
|
||||
如 '許'、'社' 等等後面是 \ 的中文字都會出搥,直到
|
||||
6.5 版以後,才加入了 multibyte 的支援。</para>
|
||||
<para>
|
||||
<application>PostgreSQL</application> 的語言支援分
|
||||
前/後端(frontend/backend),無論前端使用何種語言,
|
||||
後端都會使用設定好的語言存入資料庫中。</para>
|
||||
<para>
|
||||
這有什麼好處?例如:後端設定成繁體中文,前端設定成簡體中文,
|
||||
然後,存入的繁體中文,顯示的是簡體中文,當然,
|
||||
它不會做中、英翻譯。</para>
|
||||
<para>
|
||||
要正確使用中文,比較保險的作法是後端使用 euc_tw
|
||||
編碼,前端使用 big5 編碼,例如:</para>
|
||||
<screen>
|
||||
<prompt>%</prompt> <userinput>createdb --encoding euc_tw test</userinput> ' 建>
|
||||
立後端為 euc_tw 編碼的 db
|
||||
<prompt>%</prompt> <userinput>psql test</userinput> ' 使用 psql 管理工具,就像
|
||||
mysql 般。
|
||||
<prompt>test=#</prompt> ' 已經進入 psql
|
||||
<prompt>test=#</prompt> <userinput>\encoding big5</userinput> ' 設定前端為 big5 編碼
|
||||
<prompt>test=#</prompt> <userinput>create table test (</userinput>
|
||||
<prompt>test=#</prompt> <userinput>usrname char(20));</userinput> ' 建立 table
|
||||
<prompt>test=#</prompt> <userinput>insert into test values('許國榮');</userinput> ' 測試
|
||||
<prompt>test=#</prompt> <userinput>select * from test;</userinput> '您會看到正>
|
||||
確的答案
|
||||
<prompt>test=#</prompt> <userinput>\q</userinput></screen>
|
||||
<para>
|
||||
也可以在 <application>PostgreSQL</application> 中下
|
||||
<command>PGCLIENTENCODING=BIG5</command>
|
||||
的指令,如果是使用 <application>PHP</application>
|
||||
+ <application>PostgreSQL</application> 則使用以下方式:</para>
|
||||
<programlisting>
|
||||
$conn = pg_connect("user=postgres dbname=stip");
|
||||
pg_exec($conn, "set client_encoding to 'BIG5'");</programlisting>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.postgresql.org/">
|
||||
http://www.postgresql.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="postgresql-jdbc">
|
||||
<title>PostgreSQL + JDBC + Servlet + XMLC 中文完全解決方案</title>
|
||||
<para>作者:smallufo,Email:smallufo@bigfoot.com</para>
|
||||
<para>
|
||||
自古以來 Servlet 連結 Database 在中文方面總是有許多問題,尤其是在
|
||||
web 端,要考慮的因素更多了。有時候,form的文字遇到「許,功」等字,
|
||||
要使用者自行輸入“\”這個跳說字元;有時候明明把「許,功」insert
|
||||
進資料庫,但是取出來又會變成〈?〉;而中文的許多次常用字,
|
||||
例如宏碁的「碁」,等怪怪的字元,更是讓
|
||||
programmer 頭髮白了一半。而 encoding 又是個最重要的關鍵,常見的
|
||||
encoding 有以下幾點:</para>
|
||||
<programlisting>
|
||||
code +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
|
||||
F9D0 碁 銹 裏 墻 恒 粧 嫺 ╔ ╦ ╗
|
||||
F9E0 ╠ ╬ ╣ ╚ ╩ ╝ ╒ ╤ ╕ ╞ ╪ ╡ ╘ ╧ ╛ ╓
|
||||
F9F0 ╥ ╖ ╟ ╫ ╢ ╙ ╨ ╜ ║ ═ ╭ ╮ ╰ ╯ ■ </programlisting>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
作業系統 Locale 的 encoding
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
資料庫端的 encoding
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
javac-encoding xxx
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
ServletRequest.setContentType("texe/html; charset=xxx)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
web application deployment(web.xml) 所指定的 character-encoding="xxx"
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
new String(String.getByte("xxx),"yyy)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
如果使用 xmlc,還有 xmlc 的 encoding 以及
|
||||
org.enhydra.xml.io.OutputOptions.setXmlEncoding("xxx")
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
這幾種 encoding 萬馬奔騰,常使 programmer 轉的暈頭轉向,
|
||||
不知目前身在何處,不知多少 programmer 在此浪費青春。</para>
|
||||
<para>
|
||||
中文解決方案以前在網路上有許多做法,但是通常都不太完整,
|
||||
要不然就得大刀闊斧更動到 JDBC driver,或是重新 compile
|
||||
整個資料庫系統。而為了系統的「完整性」,我並不考慮這些做法。
|
||||
我的作法可以完整保留 postgreSQL 的完整性〈以 RPM 安裝,不用重新
|
||||
compile〉,而且 JDBC driver 不用重新 compile。
|
||||
以下的步驟後半部主要是針對 XMLC 而言,不過一般「純」的 servlet
|
||||
程式,應該很容易粹取出來。</para>
|
||||
<para>以下是我的一些環境:</para>
|
||||
<para>
|
||||
RedHat Linux 7.0 (CLE 1.0),其他的中文環境也應該沒問題。
|
||||
如果您是英文版的,請安裝 Chinese locale patch 即可。
|
||||
重點是,當您輸入 'set' 時,可以看到 'LANG=zh_TW' 這個環境變數。</para>
|
||||
<para>Servlet Engine:Resin 2.0.2</para>
|
||||
<para>posrgreSQL-7.1.3-1PGDG.i386.rpm,檔案大小 1164817 bytes,直接以
|
||||
rpm -Uvh 安裝即可,不用重新 compile。JDBC driver 也是直接使用
|
||||
postgresql-jdbc-7.1.3-1PGDG.i386.rpm 所安裝的 jdbc7.1-1.2.jar 即可。</para>
|
||||
<para>資料庫請以 Unicode 編碼〈createdb -E Unicode〉,這點最為重要。</para>
|
||||
<para>Web application Deployment(web.xml) 中的 <web-app> 不要加上
|
||||
character-encoding="xxx" 這個 attribute</para>
|
||||
<para>在 servlet 中,請設定 res.setcontentType("text/html; charset=CP950");</para>
|
||||
<para>form 的參數,直接以 getParameter("xxx") 讀取,
|
||||
再 insert 進資料庫,不用作任何轉碼。</para>
|
||||
<para>要從資料庫中讀取資料,得利用:
|
||||
new String(rs.getString("ColName").getBytes("8859_1"),"CP950") </para>
|
||||
<para>要輸出整份文件〈implement org.enhydra.xml.xmlc.html.HTMLObject 的文件〉時,
|
||||
不要用 out.println(doc.toDocument()),請改用如下的方法:</para>
|
||||
<programlisting>
|
||||
org.enhydra.xml.io.OutputOptions options = new OutputOptions();
|
||||
options.setOmitEncoding(false);
|
||||
options.setXmlEncoding("Big5");
|
||||
DOMFormatter formatter = new DOMFormatter(options);
|
||||
if(iChingVotingsPage.getDelefate() != null) {
|
||||
out.println(formatter.toString(iChingVotingsPage.getDelegate()));
|
||||
) else {
|
||||
out.println(formatter.toString(iChingVoringPage));
|
||||
}</programlisting>
|
||||
<para>Servlet 檔案要以 javac -encoding CP950 來編譯。</para>
|
||||
<para>大功告成,如此解決方案,則可以完全正常處理所有罕見以及特殊字元,
|
||||
不論是插入資料庫,從資料庫取出來在網頁上,都沒有問題。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="java">
|
||||
<title>Java 中文程式設計</title>
|
||||
<para>FreeBSD 下的 java distribution 分為 Native JDK For FreeBSD、
|
||||
Sun JDK For Linux、IBM JDK For Linux、Blackdown JDK For Linux,
|
||||
都可以在 <filename>/usr/ports/java</filename> 目錄下找到,
|
||||
For Linux 的部分只要裝上 Linux 模擬器就可以執行,
|
||||
而 Native JDK 就必須自己從 source 編譯。
|
||||
而且安裝上都必須依照步驟先去網站上下載所需的檔案,
|
||||
放置到 <filename>/usr/ports/distfiles</filename>。</para>
|
||||
<para>以最困難的 <filename role="package">java/jdk13</filename> 安裝為例,
|
||||
你必須到 <ulink url="http://www.sun.com/software/java2/download.html">
|
||||
Sun Community Source Licensing</ulink> 下載 j2sdk-src-scsl.zip 和
|
||||
j2sdk-bin.scsl.zip 這兩個檔案,並到
|
||||
<ulink url="http://www.eyesbeyond.com/freebsddom/java/jdk14.html">
|
||||
Java 2 on FreeBSD</ulink> 下載 bsd-jdk14-patches.tar.gz。
|
||||
又因為編譯的時候需要 <filename role="package">java/linux-sun-jdk14</filename>,
|
||||
所以還需要先安裝好才行。
|
||||
並且根據編譯的需求,我們還需要一個 <option>linprocfs</option>,
|
||||
你可以用 <command>mount -t linprocfs linprocfs /compat/linux/proc</command>
|
||||
來將 linprocfs 掛上。並在系統上預留 2.5GB 的硬碟空間來進行編譯,
|
||||
當以上都準備就緒,就可以開始編譯然後等明天再來驗收囉。</para>
|
||||
<para>想知道您的 JDK 或 JRE 會用什麼樣的編碼方式來和作業系統溝通,
|
||||
請執行下面的 Java 程式:</para>
|
||||
<programlisting>
|
||||
public class ShowNativeEncoding {
|
||||
public static void main(String[] args) {
|
||||
String enc = System.getProperty("file.encoding");
|
||||
System.out.println("NativeEncoding:" + enc);
|
||||
System.out.println("成功");
|
||||
}
|
||||
}</programlisting>
|
||||
<screen>
|
||||
&prompt.user; <userinput>javac ShowNativeEncoding.java</userinput>
|
||||
&prompt.user; <userinput>java ShowNativeEncoding</userinput>
|
||||
NativeEncoding:Big5
|
||||
成功</screen>
|
||||
<para>
|
||||
如果出現以上的訊息,就表示中文正常,如果沒有的話,
|
||||
請確定您的 LC_CTYPE 是 zh_TW.Big5,或是用
|
||||
<command>javac -encoding CP950 ShowNativeEncoding.java</command>
|
||||
來進行編譯,應該會出現如上的顯示才對。</para>
|
||||
<note>
|
||||
<para>Big5:這是繁體中文 de facto 標準。 </para>
|
||||
<para>
|
||||
MS950 或 Cp950:ASCII + Big5,用於台灣和香港的繁體中文 MS
|
||||
Windows作業系統。</para></note>
|
||||
<para>筆者的環境設定 <filename>~/.cshrc</filename></para>
|
||||
<programlisting>
|
||||
# For JAVA jdk1.3.1
|
||||
setenv JAVA_HOME /usr/local/jdk1.3.1
|
||||
setenv CLASSPATH /usr/local/jdk1.3.1/lib/tools.jar:/usr/local/share/java/classes/:./
|
||||
setenv PATH /usr/local/jdk1.3.1/bin:$PATH</programlisting>
|
||||
<para>如果要執行 applet 或是 swing的話,
|
||||
請按照以下步驟設定才能正確的看到中文字,
|
||||
<filename>font.properties.zh_TW</filename> 為 Forth 提供,
|
||||
該設定檔專給 arphicttf 使用:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/local/jdk1.3.1/jre/lib/</userinput>
|
||||
&prompt.root; <userinput>fetch http://freebsd.sinica.edu.tw/~statue/conf/font.properties.zh_TW</userinput></screen>
|
||||
<para>
|
||||
經筆者測試在 mozilla-1.0 + jdk1.3.1p6_4 之後已經不需要設定就可以正確的看到中文,
|
||||
如果沒辦法就手動作如下步驟:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/X11R6/lib/mozilla/plugins/</userinput>
|
||||
&prompt.root; <userinput>ln -s /usr/local/jdk1.3.1/jre/plugin/i386/ns600/libjavaplugin_oji.so libjavaplugin_oji.so</userinput></screen>
|
||||
<figure>
|
||||
<title>applet snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/applet" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<figure>
|
||||
<title>swing snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/swing" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
參考:
|
||||
<ulink url="http://www.oreilly.com.tw/sleepless/java_big5_1.htm">
|
||||
Java繁體中文處理完全攻略(一)</ulink>、
|
||||
<ulink url="http://www.oreilly.com.tw/sleepless/java_big5_2.htm">
|
||||
Java 繁體中文處理完全攻略(二)</ulink>。</para>
|
||||
<para>
|
||||
WWW: <ulink url="http://java.sun.com/">
|
||||
http://java.sun.com/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="perl">
|
||||
<title>Perl 中文程式設計</title>
|
||||
<para>如何排除 Perl 程式處理中文資料的障礙?</para>
|
||||
<para>
|
||||
在 CGI Perl 程式中,有許多符號字元是有特殊用途的,
|
||||
而不幸的有某些這樣的字元卻與中文字的第二個位元組互相衝突,
|
||||
以至於會有中文字顯示或比對不正確,甚至是產生錯誤結果的現象,
|
||||
尤其是 | 及 \ 這兩個字元,所幸我們還有個 quotemeta 指令可以使用,
|
||||
這個指令可以將指定的字串中每個字元的前面都再多加上一個 \
|
||||
這個字元,使得字串內的特殊字元在處理時被視為單純的字碼,
|
||||
請參考下列的範例:</para>
|
||||
<para>
|
||||
假設 $str 是一個要做搜尋比對的中文字串,而 $line
|
||||
是逐行讀入的資料檔內容:</para>
|
||||
<programlisting>
|
||||
$restr = quotemeta $str;
|
||||
if ($line !~ m/$restr/i) { ......
|
||||
}</programlisting>
|
||||
<para>
|
||||
另外若不是以變數來處理的字串,通常我們會使用雙引號來標示及處理,
|
||||
然而這也是會發生上述的障礙,但是當您直接對雙引號括住的字串使用
|
||||
quotemeta 來處理時卻又會怪怪的,那怎麼辦呢?很間單!
|
||||
將雙引號改為單引號就可以囉~因為單引號不會對其內的字元作特殊處理,
|
||||
換句話講在單引號之內的文字資料將會原原本本的呈現出來,
|
||||
不會去解譯變數也不會處理 escape 字元 ,例如原來的敘述是:</para>
|
||||
<programlisting>
|
||||
print "測試成功的$msg訊息!\n";</programlisting>
|
||||
<para>應改為:</para>
|
||||
<programlisting>
|
||||
print '測試成功的訊息!';</programlisting>
|
||||
<para>
|
||||
請特別注意 \n 換行符號及 $msg 變數也需拿掉,因為單引號並不處理
|
||||
escape 字元及變數,如果不將 \n 符號及 $msg 變數拿掉,
|
||||
那麼顯示出來的字樣將會是</para>
|
||||
<screen>
|
||||
成功的$msg訊息!\n</screen>
|
||||
<para>
|
||||
,如果您仍希望顯示成原來包含變數及換行的效果,
|
||||
那就必須將單引號與雙引號資料併用,同時以 .
|
||||
符號來連結成完整的輸出敘述:</para>
|
||||
<programlisting>
|
||||
print '成功的'.$msg.'訊息!'."\n";</programlisting>
|
||||
<para>
|
||||
上述結論就是當印出 成功的 與 訊息! 字樣是使用單引號,
|
||||
而換行的 \n 則是用雙引號。</para>
|
||||
<para>以下是一個將檔案中所有的中文字移除的程式範例:</para>
|
||||
<programlisting>
|
||||
#!/usr/bin/perl -w
|
||||
# ./bg5rm.pl filename
|
||||
# and it's will generate a filename.bg5rm
|
||||
$ifname=$ARGV[0];
|
||||
open(IF,"$ifname");
|
||||
open(OF,">${ifname}.bg5rm");
|
||||
$big5 = "[\xA1-\xF9][\x40-\x7E\xA1-\xFE]";
|
||||
while(<IF>) {
|
||||
s/$big5//g;
|
||||
print OF $_;
|
||||
print $_;
|
||||
}
|
||||
close(IF);
|
||||
close(OF);</programlisting>
|
||||
<para>以下是一個將文章中的中英文 word split 進 list:</para>
|
||||
<programlisting>
|
||||
my $big5 = q{
|
||||
[\xA1-\xF9][\x40-\x7E\xA1-\xFE]
|
||||
};
|
||||
my $big5plus = q{
|
||||
[\x81-\xFE][\x40-\x7E\x80-\xFE]
|
||||
};
|
||||
my @chars = /$big5|$ascii+/gox;
|
||||
my @charsplus = /$big5plus|$ascii+/gox;</programlisting>
|
||||
<para>MPX 的 <ulink url="http://www.hkln.net/perl/technique/chinese.htm">
|
||||
解決 Perl 處理中文字的問題</ulink></para>
|
||||
<para>CJKV Information Processing 這本書有些不錯的 perl 程式
|
||||
<ulink url="ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/perl/">
|
||||
範例</ulink>,其中 *.pdf 是一些討論 perl 下處理 multibyte 的
|
||||
papers。</para>
|
||||
<para>Erik Peterson 寫了一些有用的 <ulink
|
||||
url="http://www.mandarintools.com/">Perl 程式</ulink>,
|
||||
可處理中文轉換。</para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.perl.org/">
|
||||
http://www.perl.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mysql">
|
||||
<title>MySQL Localisation and International Usage</title>
|
||||
<para>WWW: <ulink url="http://www.mysql.com/documentation/mysql/bychapter/index.html#Localisation">
|
||||
MySQL Localisation and International Usage</ulink></para>
|
||||
<para>動態能從 my.cnf 調整的部份並沒有 big5.conf:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>ls /usr/local/share/mysql/charsets</userinput>
|
||||
Index danish.conf greek.conf koi8_ukr.conf usa7.conf
|
||||
README dec8.conf hebrew.conf latin1.conf win1250.conf
|
||||
cp1251.conf dos.conf hp8.conf latin2.conf win1251.conf
|
||||
cp1257.conf estonia.conf hungarian.conf latin5.conf win1251ukr.conf
|
||||
croat.conf german1.conf koi8_ru.conf swe7.conf</screen>
|
||||
<para>靜態要在 compile 階段完成的部份:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>ls mysql-3.23.55/strings/ctype*.c</userinput>
|
||||
mysql-3.23.55/strings/ctype-big5.c mysql-3.23.55/strings/ctype-sjis.c
|
||||
mysql-3.23.55/strings/ctype-czech.c mysql-3.23.55/strings/ctype-tis620.c
|
||||
mysql-3.23.55/strings/ctype-euc_kr.c mysql-3.23.55/strings/ctype-ujis.c
|
||||
mysql-3.23.55/strings/ctype-gb2312.c mysql-3.23.55/strings/ctype.c
|
||||
mysql-3.23.55/strings/ctype-gbk.c</screen>
|
||||
<para>也就是說 multibyte support 必須要 compile 時就給他下好這個參數,
|
||||
是否能直接設定 my.cnf 達到 --with-charset=big5 的效果還不確定。</para>
|
||||
<para>檢驗方式,進入 mysql 後打:</para>
|
||||
<screen>
|
||||
mysql> <userinput>show variables like 'character_sets';</userinput>
|
||||
mysql> <userinput>show variables like 'character_set';</userinput></screen>
|
||||
<para>那 character set 影響那些呢?就我所知的有 ORDER BY 和 GROUP BY
|
||||
的順序,那特殊中文字 insert 進資料的問題還是在嗎?</para>
|
||||
<note><para>另一常見的問題是,MySQL 無法輸入中文資料庫名稱、中文表格名稱、
|
||||
中文欄位名稱?其實是可以的,只要用 <literal>`</literal>
|
||||
將中文字包含在內就可以,像是 <command>CREATE DATABASE `哈囉`;</command>。</para></note>
|
||||
<para>WWW: <ulink url="http://www.mysql.com/">
|
||||
http://www.mysql.com/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="ldap">
|
||||
<title>在 LDAP 下使用中文</title>
|
||||
<para>Contributed by duncanlo (duncan@twn.wox.org)</para>
|
||||
<para>Last Update: 2003年 4月24日 周四 05時13分04秒 CST</para>
|
||||
<para>如果是要將 .ldif 轉入,必須先將中文轉成 utf-8。</para>
|
||||
<para>安裝 <filename role="package">converter/iconv</filename>,
|
||||
假設要轉碼的檔案是 big5.ldif,轉出來的檔案是 utf-8.ldif。</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>iconv -f big5 -t utf-8 big5.ldif > utf-8.ldif</userinput></screen>
|
||||
<para>然後就可以用 <command>ldapadd</command> 來將 utf-8.ldif 轉入 ldap 了。</para>
|
||||
<figure>
|
||||
<title>ldap snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/ldap" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.iit.edu/~gawojar/ldap/">
|
||||
Java LDAP Browser/Editor</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="perl-cgi">
|
||||
<title>用 perl 寫 CGI 時的中文顯示問題?</title>
|
||||
<para>Contributed by fjj.bbs@bbs.csie.ncku.edu.tw (Frank Millers)</para>
|
||||
<para>Last Update: Sun Nov 2 17:45:35 2003</para>
|
||||
<programlisting>
|
||||
use CGI;
|
||||
my $q = new CGI;
|
||||
$q->head(charset=big5);
|
||||
$q->start_html(lang=big5);</programlisting>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.4
|
||||
-->
|
||||
|
||||
<chapter id="dict">
|
||||
<title>字典軟體</title>
|
||||
<para></para>
|
||||
<sect1 id="dictd-database">
|
||||
<title>dictd-database - dictd 的字典檔資料庫</title>
|
||||
<para>一套中文與英文的 <application>dictd</application>
|
||||
字典檔資料庫,所以必須搭配使用。
|
||||
而 <application>chinese/dictd</application> 則是修正特殊中文字的問題,
|
||||
如果想要正常使用漢英字典(Cedict),那麼就必須安裝此修正過的 port。
|
||||
</para>
|
||||
<para>裡面目前包含四個字典檔,moecomp 和 netterm 都是英漢字典檔,
|
||||
而 pydict 則是英漢、漢英字典檔,目前只有做英漢的部分,
|
||||
cedict 則也是英漢、漢英字典檔,不過目前只有做漢英的部分。</para>
|
||||
<para>在安裝完後,必須先修改 <filename>/usr/local/etc/dictd.conf
|
||||
</filename>,這個檔案是給 <application>net/dictd-database</application>
|
||||
使用的,如果不打算用英英字典,那麼就全部換成以下的內容來符合
|
||||
<application>chinese/dictd-database</application> 的要求。</para>
|
||||
<programlisting>
|
||||
database moecomp { data "/usr/local/lib/dict/moecomp.dict.dz"
|
||||
index "/usr/local/lib/dict/moecomp.index" }
|
||||
database netterm { data "/usr/local/lib/dict/netterm.dict.dz"
|
||||
index "/usr/local/lib/dict/netterm.index" }
|
||||
database pydict { data "/usr/local/lib/dict/pydict.dict.dz"
|
||||
index "/usr/local/lib/dict/pydict.index" }
|
||||
database cedict { data "/usr/local/lib/dict/cedict.dict.dz"
|
||||
index "/usr/local/lib/dict/cedict.index" }</programlisting>
|
||||
<para>然後就可以啟動 <command>/usr/local/etc/rc.d/dictd.sh start
|
||||
</command>。</para>
|
||||
<para>接著在去 <filename>/usr/ports/textproc/dict</filename>
|
||||
安裝 <application>dict</application>,這是一個可以用來存取
|
||||
DICT 伺服器的用戶端,只能用命令列模式。</para>
|
||||
<para>用法範例如下:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>dict -h localhost -D</userinput>
|
||||
Databases available:
|
||||
moecomp Taiwan MOE computer dictionary
|
||||
netterm Network Terminology
|
||||
pydict pydict data
|
||||
&prompt.user; <userinput>dict -h localhost -d moecomp hello | less</userinput>
|
||||
1 definition found
|
||||
|
||||
From Taiwan MOE computer dictionary [moecomp]:
|
||||
|
||||
hello
|
||||
呼叫
|
||||
&prompt.user; <userinput>dict -h localhost 成功</userinput>
|
||||
1 definition found
|
||||
|
||||
From Chinese to English dictionary [cedict]:
|
||||
|
||||
成功
|
||||
[cheng2 gong1]
|
||||
success
|
||||
to succeed</screen>
|
||||
<para>在 <filename>/usr/ports/net/dictd-database</filename>
|
||||
還有其他的字典檔資料庫,可以參考看看是否需要。</para>
|
||||
<para>筆者通常都會安裝 <filename>/usr/ports/net/dictd-database
|
||||
</filename>,然後將所有的資料庫都寫入 <filename>
|
||||
/usr/local/etc/dictd.conf</filename>,然後用
|
||||
<command>dict -h localhost hello</command> 來對所有的資料庫查詢,
|
||||
在查單字的時候蠻方便的。</para>
|
||||
<figure>
|
||||
<title>dict snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/dict" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>cedict: <ulink url="http://www.mandarintools.com/cedict.html">
|
||||
CEDICT: Chinese-English Dictionary</ulink></para>
|
||||
<para>dict: <ulink url="http://www.dict.org/">
|
||||
http://www.dict.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="pydict">
|
||||
<title>pyDict - 英漢、漢英兩用字典</title>
|
||||
<para>在眾多的 Unix-like 翻譯軟體中,鮮少能找到對中文翻譯的程式,而
|
||||
<application>pyDict</application> 就是這麼一個好用的工具!
|
||||
pyDict 的字典檔是 xdict 轉出來的, 並經過作者的整理與改善.</para>
|
||||
<para><application>pyDict</application> 是用
|
||||
<application>python</application>
|
||||
加上 <application>gtk</application> 的界面工具集(widgets)
|
||||
寫成的英漢、漢英兩用字典。
|
||||
而且支援 XIM,是目前中文最好用的字典。
|
||||
還有個智慧模式,使用起來是不是跟一般的電子字典類似呢?
|
||||
</para>
|
||||
<para>啟動說明</para>
|
||||
<programlisting>
|
||||
pydict [options] [word]
|
||||
|
||||
options:
|
||||
-h 列出文字模式下的說明
|
||||
-i console互動模式
|
||||
-e [word] 英漢查詢(可不加-e)
|
||||
-c [word] 漢英查詢 </programlisting>
|
||||
<para>console 模式說明:</para>
|
||||
<para>在終端視窗中會有word:的提示符號,使用者可以鍵入想查
|
||||
詢的單字。如果想轉成其他模式可以鍵入下列字串:</para>
|
||||
<programlisting>
|
||||
-c 轉換成漢英模式
|
||||
-e 轉換成英漢模式</programlisting>
|
||||
<para>如果要離開console互動模式,可以鍵入-q或是在word:後直
|
||||
接按Enter鍵就可以了。</para>
|
||||
<para>如果中文有問題的話,表示 gtk 的中文字型沒設定好,
|
||||
用 <command>cp /usr/X11R6/lib/X11/pyDict/gtkrc.zh_TW.big5.sample ~/.gtkrc</command>
|
||||
將 pyDict 的範例拷貝過來使用就可以了。</para>
|
||||
<para>作者已經很久沒有維護, 目前 <ulink url="http://people.redhat.com/llch/pydict/">llch at redhat.com</ulink> 有修改並移植到 pygtk2 之上.</para>
|
||||
<figure>
|
||||
<title>pydict snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/pydict" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://sourceforge.net/projects/pydict/">
|
||||
http://sourceforge.net/projects/pydict/</ulink></para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.linux.org.tw/~plateau/linux_notes/">
|
||||
http://www.linux.org.tw/~plateau/linux_notes/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="stardict">
|
||||
<title>stardict - 中文與英文的翻譯字典</title>
|
||||
<para>
|
||||
一個中文與英文的翻譯字典,由 Motif 開發的,在這個軟體中包含了
|
||||
星際譯王源程序、圖標和背景圖形文件,漢字字體、音標字體
|
||||
,詞庫、音標庫,Readme、開發計劃等文件。 </para>
|
||||
<para>
|
||||
功能特性描述:近五萬單詞,常用詞帶音標、具有模糊匹配功能、
|
||||
具有屏幕取詞功能、自帶漢字字體,無需漢字環境、繁簡兩種字體。
|
||||
</para>
|
||||
<para>預設為簡體,若要看到繁體介面,則修改 <filename>
|
||||
/usr/X11R6/share/stardict/hzfont/fonts.dir</filename></para>
|
||||
<programlisting>
|
||||
--- fonts.dir.orig Sat Nov 3 01:17:39 2001
|
||||
+++ fonts.dir Sat Nov 3 01:14:25 2001
|
||||
@@ -1,3 +1,3 @@
|
||||
2
|
||||
-hz16.pcf hz16
|
||||
+hz16ft.pcf hz16
|
||||
yb10x20.pcf yb10x20</programlisting>
|
||||
<figure>
|
||||
<title>stardict snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/stardict" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="stardict2">
|
||||
<title>stardict2</title>
|
||||
<para>星際譯王 2.0.0,一個運行在GNOME環境下的國際化的詞典軟件,
|
||||
有選中區取詞,通配符匹配,模糊查詢等強大功能。</para>
|
||||
<para>安裝 <filename role="package">chinese/stardict2</filename>。</para>
|
||||
<figure>
|
||||
<title>stardict2 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/stardict2" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://stardict.cosoft.org.cn/">
|
||||
http://stardict.cosoft.org.cn/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="oxford">
|
||||
<title>oxford</title>
|
||||
<para>oxford is a English to Chinese dictionary, written in Perl.</para>
|
||||
<para>安裝 <filename role="package">chinese/oxford</filename>。</para>
|
||||
<figure>
|
||||
<title>oxford snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/oxford" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://igloo.its.unimelb.edu.au/Blowfish/">
|
||||
http://igloo.its.unimelb.edu.au/Blowfish/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="edict-big5">
|
||||
<title>edict-big5 - 日文漢字轉中文漢字後的漢英字典</title>
|
||||
<para>EDICT 本來是日英字典,不過我透過 <filename role="package">
|
||||
lang/perl5.8</filename> 的 <command>piconv</command> 將 EUC-JP 轉成 Big5,
|
||||
有許多字無法找到對應的 Big5 所以這個字典檔仍然有許多問題,
|
||||
筆者也將格式轉成 dict 的格式,因為偏好原因。</para>
|
||||
<para>選擇 <command>piconv</command> 的原因是目前他比
|
||||
<command>iconv</command> 具備更多的轉碼對應,
|
||||
這樣子才能讓能看到的 Big5 更多。</para>
|
||||
<para><application>edict-big5</application> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-ports/edict-big5</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
<figure>
|
||||
<title>edict-big5 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/edict-big5" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.csse.monash.edu.au/~jwb/edict.html">
|
||||
http://www.csse.monash.edu.au/~jwb/edict.html</ulink></para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,943 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.26
|
||||
-->
|
||||
|
||||
<chapter id="difficult">
|
||||
<title>中文環境</title>
|
||||
<para>在談中文環境前,必須先正名一下,台灣是 "Taiwan, Republic of China"
|
||||
或者簡稱 "Taiwan, ROC"、"Taiwan",千萬不要用 "Taiwan, Province of China",
|
||||
兩者的差異性十分巨大,不管是在民主政治、人權、言論自由等等。</para>
|
||||
|
||||
<sect1 id="chinese-intro">
|
||||
<title>漢字概論</title>
|
||||
<para>漢字是由部首等較小的元件組成的;可以將部首等當作建築積木用。
|
||||
這些元件可作為構成漢字的基本單位用。漢字使用 214 種部首作索引。</para>
|
||||
<para>漢字的種類很多;常見的有四種:象形(pictographs)、
|
||||
指事(simple ideographs)、會意(compound ideographs)、
|
||||
形聲(phonetic ideographs)。</para>
|
||||
<para>最基本的是象形字;象形字如同是一張小圖,通常與其所表達的對象很像。
|
||||
如:日、月、山、火、木、車、口。
|
||||
而指事字則表達數字和方向等抽象概念或意思。
|
||||
如:上、下、中、一、二、三。
|
||||
象形字和指事字可以組成更複雜的字,通常其意思是各個組成部分的意思的綜合,
|
||||
稱為會意字。
|
||||
如:林、森、明。
|
||||
形聲字佔了漢字的 90% 以上,一般至少有兩個部分;
|
||||
一個是語音,另一個則是字源。
|
||||
如:銅、洞。
|
||||
漢字可以合併成詞組,用來表達更複雜的意思或概念。</para>
|
||||
<para>漢字的發展是以表意的圖畫開始的,並保持字形狀與語意的連結。</para>
|
||||
<table>
|
||||
<title>不同時期的漢字總數</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>西元</entry>
|
||||
<entry>漢字總數</entry>
|
||||
<entry>參考文獻</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>100</entry>
|
||||
<entry>9,353</entry>
|
||||
<entry>說文解字</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1716</entry>
|
||||
<entry>47,021</entry>
|
||||
<entry>康熙字典</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1986</entry>
|
||||
<entry>56,000</entry>
|
||||
<entry>漢語大字典</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1994</entry>
|
||||
<entry>85,000</entry>
|
||||
<entry>中華字海</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>兩千年來,漢字的總數增加了將近五倍。在此期間出現的漢字大多數是形聲字。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="holo">
|
||||
<title>閩南語和客家話</title>
|
||||
<para>Contributed by KhoGuan Phuann</para>
|
||||
<para>Last Update: 2003年10月13日 周一 02時17分56秒 CST</para>
|
||||
<para>在台灣,漢字的使用,除了國語(Mandarin)的書寫以外,
|
||||
也有用漢字寫成的閩南話(Holo)或客家話(Hakka)的文字作品
|
||||
(以下敘述中的台灣話(Taiwanese)包括閩南話及客家話)。
|
||||
近年來,雖然政府已開始進行母語教育,但其書面文字仍未標準化。
|
||||
要完全使用漢字來充份書寫台灣話,實際上極困難。
|
||||
不是要用到一些冷僻的漢字,就是無漢字可用,要創造新的漢字。
|
||||
一些過去民間常用的台灣話漢字(如 个 ),Big5未收;
|
||||
即使是 Unicode 4.0 也還有所遺漏。更不用說台灣話中有許多外來語,
|
||||
勉強用漢字近音字來表記,非常笨拙。</para>
|
||||
<para>有許多人主張用漢字與拚音文字混用的方式來書寫台灣話,
|
||||
以解決上述的問題,也有人主張完全使用拚音文字。</para>
|
||||
<para>台灣話的拚音文字中,歷史最長久的是「白話字」
|
||||
(Pçh-öe-ji,簡寫為 POJ)。
|
||||
白話字就是教會羅馬字(Church Romanization),
|
||||
十九世紀從西洋來到福建及廣東傳教的長老教會牧師,
|
||||
開始設計閩南話及客家話的羅馬拚音書寫系統,並傳播到台灣來。
|
||||
歷經變遷,目前教會羅馬字是最多人使用的台灣話拚音文字,
|
||||
並不限於教會人士。</para>
|
||||
<para>近年台灣語文學會(Taiwan Languages and Literature Society)
|
||||
以教會羅馬字為基礎加以修訂,制定了台灣語言音標方案(Taiwanese
|
||||
Language Phonetic Alphabet,簡寫為 TLPA)。自教育部於 1998
|
||||
年公告以來,有越來越多台灣話的語文教材、民間採集、文學作品
|
||||
以及研究著作採用這套音標。</para>
|
||||
<para>自由軟體中,yudit 這個 Unicode 編輯器,配合相應的 keymap
|
||||
可以很方便的輸入 POJ 或 TLPA。詳情請參考
|
||||
<ulink url="http://linux.taigi.idv.tw/nngthe/yudit">
|
||||
潘科元台語 Linux 網站</ulink>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="chinese-code">
|
||||
<title>編碼標準</title>
|
||||
<para>在電腦開始使用的時候,所有的字都只用 1byte 來儲存,
|
||||
1byte 包含 8bits,每個 bits 都只能表示 on/off,
|
||||
也就是 1byte 只能表示 0000 0000 到 1111 1111 的編碼範圍,
|
||||
只有 256 個編碼空間,這對中文而言,是不夠的。</para>
|
||||
<para>我們知道中文字在目前常見的電腦上是由兩個位元組(two bytes)
|
||||
所編碼組成的。
|
||||
最常見的編碼方式有台灣地區所通行的 Big5 編碼,及大陸地區所使用的
|
||||
GB 編碼。而且開頭的位元組幾乎都是大於 128 的數值,也就是所謂
|
||||
non-ASCII 碼的範圍(ASCII 是指小於 128 的編碼)。</para>
|
||||
<para>字集(Character Set)是一組符號或文字的組合,
|
||||
而編碼(Encoding)則是將這一組符號或文字以適當的方式編入位元組中,
|
||||
以便電腦能夠表示與儲存。
|
||||
目前現有的字集如中文字集、英文字集、日文字集等,
|
||||
而中文編碼則是選取部份或全部字集中的部分或全部字,
|
||||
給予一個號碼,如Big5 包含部分中文字集、英文字集、部分日文字集等。</para>
|
||||
<para>接下來就是萬碼奔騰,眾多中文編碼標準的問題,
|
||||
目前台灣使用的中文編碼存在許多問題,第一是中文編碼有數種
|
||||
Big5、CCCII、CNS11643、Big5E、Big5+、ISO 10646、CP950,
|
||||
每個編碼所包含的中文字數不同,編碼方式也不相同,
|
||||
而且大部分都沒有標準規格,
|
||||
第二是常用的 Big5 編碼字數不足。</para>
|
||||
<para>雖然常用的 Big5 已經使用 2bytes 來表示中文字,但是
|
||||
2bytes = 16bits = 2^16 = 65536 個編碼空間,
|
||||
以 Big5 的標準而言,為了要和 ASCII 能夠相容,只能使用兩萬多字,
|
||||
現存的中文字最少在七萬以上,造成許多字在 Big5 的系統下,
|
||||
無法使用。在加上中文標準繁多,卻又沒有最後的標準規格,
|
||||
各家廠商所實做產品也就未必相容。
|
||||
最明顯的例子就是日文平假片假名,
|
||||
在這些中文編碼中並不是每個都包含,
|
||||
當遇到所謂的「Big5日文」時,就會產生許多問題。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="ascii">
|
||||
<title>ASCII</title>
|
||||
<para>ASCII 分成兩個區域,0x00 到 0x1F 給控制字元用,共十六個位置。
|
||||
0x20 到 0x7F 給一般的圖形字元用(大小寫英文、數字和符號),
|
||||
有 94 個位置,0x20 和 0x7F 分別是 SPACE 和 DELETE。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="iso8859-1">
|
||||
<title>ISO8859-1</title>
|
||||
<para>又稱為 Latin-1,0x00 到 0x1F 給控制字元用,共十六個位置。
|
||||
0x20 到 0x7F 給一般的圖形字元用(大小寫英文、數字和符號),
|
||||
0xA0 到 0xFF 為 Latin-1 額外加的部份,
|
||||
由於使用了八位元,讓目前許多僅支援 ISO8859-1 卻不支援 Big5 的,
|
||||
可以暫時的使用而不會有太多的問題,像是 vi, write, talk, talk,
|
||||
finger, mail 等等的 FreeBSD 內建程式在顯示中文可以運作,
|
||||
因為這些程式在處理時不會把 Latin-1 額外加的部份過濾掉,
|
||||
中文的顯示也就沒有問題。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="big5">
|
||||
<title>BIG5</title>
|
||||
<para>BIG5 是在 CCCII 不為政府單位採納,
|
||||
國家頒布的中文標準碼又不堪用的情況下,
|
||||
在民國 73 年,由台北市電腦公會主導,聯合了十三家業者,
|
||||
共同制定,又稱為 BIG5_1984
|
||||
(包括 5401 個常用字、7652 個次常用字、以及 441 個各式符號)。
|
||||
Big5 的字符空間是個非連續的 94x157 矩陣,其容量為 14,758 位。</para>
|
||||
<para>BIG5_ETen 為倚天中文在原本的 BIG5 碼上,
|
||||
增加了日文、俄文、輸入法特殊符號、七個擴充字、以及表格符號區。</para>
|
||||
<para>CP950 是微軟在原本的 BIG5 碼上,
|
||||
增加了七個擴充字、以及表格符號區。</para>
|
||||
<para>如不去考慮特殊符號,及後來的七個擴充字,
|
||||
將所有的字分成兩大群: 常用字區與次常用字區,
|
||||
每一個字區分別用筆畫來排序,
|
||||
同一個筆畫的字,依部首來排。</para>
|
||||
<para>目前主推的是 BIG5_ETen,每個字由兩個位元組(2 bytes)組成,
|
||||
其第一位元組編碼範圍為 0xA1 ... 0xF9,
|
||||
第二位元組編碼範圍為 0x40 ... 0x7E 與 0xA1 ... 0xFE,
|
||||
總計收入 13868 個字
|
||||
(包括 5401 個常用字、7652 個次常用字、7 個擴充字、以及 808 個各式符號)
|
||||
,其中可以大致劃分為以下幾個字區:</para>
|
||||
<note><para>由於 CNS11643-1992 初期的不堪用,
|
||||
Big5 雖然不是國家標準,但是在台灣比 CNS11643-1992
|
||||
的國家規格用的更廣。換句話說,Big5 是台灣的業界標準
|
||||
(de facto standard)。</para></note>
|
||||
<table>
|
||||
<title>BIG5 字區與編碼範圍</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>第一位元組</entry>
|
||||
<entry>第二位元組</entry>
|
||||
<entry>字區</entry>
|
||||
<entry>制定</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>A1..A2</entry>
|
||||
<entry>40..7E, A1..FE</entry>
|
||||
<entry>各種符號區</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>A3</entry>
|
||||
<entry>40..7E, A1..BF</entry>
|
||||
<entry>各種符號區 (包括標點符號、ASCII 全形符號、注音符號等)</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>A3</entry>
|
||||
<entry>E1</entry>
|
||||
<entry>歐元符號</entry>
|
||||
<entry>CP950</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>A4..C5</entry>
|
||||
<entry>40..7E, A1..FE</entry>
|
||||
<entry>常用字區</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>C6</entry>
|
||||
<entry>40..7E</entry>
|
||||
<entry>常用字區</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>C6</entry>
|
||||
<entry>A1..FE</entry>
|
||||
<entry>罕用符號區</entry>
|
||||
<entry>倚天</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>C7</entry>
|
||||
<entry>40..7E, A1..FE</entry>
|
||||
<entry>罕用符號區 (包括日文、俄文等)</entry>
|
||||
<entry>倚天</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>C8</entry>
|
||||
<entry>40..7E, A1..D3</entry>
|
||||
<entry>罕用符號區 (包括俄文、輸入法特殊符號等)</entry>
|
||||
<entry>倚天</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>C9..F8</entry>
|
||||
<entry>40..7E, A1..FE</entry>
|
||||
<entry>次常用字區</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F9</entry>
|
||||
<entry>40..7E, A1..D5</entry>
|
||||
<entry>次常用字區</entry>
|
||||
<entry>1984</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F9</entry>
|
||||
<entry>D6..DC</entry>
|
||||
<entry>七個擴充字</entry>
|
||||
<entry>倚天</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>F9</entry>
|
||||
<entry>DD..FE</entry>
|
||||
<entry>表格符號區</entry>
|
||||
<entry>倚天</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<table>
|
||||
<title>七個擴充字</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>擴充字</entry>
|
||||
<entry>BIG5 碼</entry>
|
||||
<entry>Unicode 碼</entry>
|
||||
<entry>BIG5_1984 的同義字</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>碁</entry>
|
||||
<entry>0xF9D6</entry>
|
||||
<entry>0x88CF</entry>
|
||||
<entry>棋</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>銹</entry>
|
||||
<entry>0xF9D7</entry>
|
||||
<entry>0x92B9</entry>
|
||||
<entry>鏽</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>裏</entry>
|
||||
<entry>0xF9D8</entry>
|
||||
<entry>0x7CA7</entry>
|
||||
<entry>裡</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>墻</entry>
|
||||
<entry>0xF9D9</entry>
|
||||
<entry>0x58BB</entry>
|
||||
<entry>牆</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>恒</entry>
|
||||
<entry>0xF9DA</entry>
|
||||
<entry>0x6052</entry>
|
||||
<entry>恆</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>粧</entry>
|
||||
<entry>0xF9DB</entry>
|
||||
<entry>0x7881</entry>
|
||||
<entry>妝</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>嫺</entry>
|
||||
<entry>0xF9DC</entry>
|
||||
<entry>0x5AFA</entry>
|
||||
<entry>嫻</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>Big5 有兩個重複編碼的漢字,分別是 A461, C94a 和 DCD1, DDFC,
|
||||
CNS11643-1992 刪除了第二次編碼的漢字(C94A 和 DDFC)。</para>
|
||||
<para>BIG5 最大的問題是字數不足。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cns11643">
|
||||
<title>CNS11643</title>
|
||||
<para>CNS11643 中文標準交換碼, 一般簡稱 CNS 碼或 CNS11643 ,
|
||||
因<ulink url="http://www.cns11643.gov.tw/">中央標準局
|
||||
</ulink>公佈及修訂之先後而有二個版本,一般稱為
|
||||
CNS11643-1986 版(1986公告版)及 CNS11643-1992 版(1992年修訂版),
|
||||
此二個版本之差異僅在於其所編定之字數不同。 75 年公告之 CNS11643-1986
|
||||
定義 13,051個漢字(去掉 Big5 多出兩個漢字),
|
||||
名稱為「通用漢字標準交換碼」
|
||||
81 年修訂版 CNS11643-1992 擴編為48,027 個漢字,
|
||||
擴充後修訂名稱為「中文標準交換碼」。</para>
|
||||
<para>CNS11643 以2個位元組 (byte)為中文碼編碼單位。
|
||||
字碼中之 00 至 20 以及 7F 均予避開,
|
||||
則 7bit 字碼集共有 94 個編碼位置,
|
||||
兩個位元組共可編 8,836 個字碼,訂為一字面。
|
||||
依字之使用頻率編排於各字面。
|
||||
依先筆畫後部首排列順序編碼。</para>
|
||||
<para>CNS11643-1992 的編碼法為:ISO-2022-CN、ISO-2022-CN-EXT、
|
||||
EUC-TW。從某角度來看,可以把 Big5 看成是 CNS11643-1992
|
||||
第一和第二字面的一種編碼法,
|
||||
因為 CNS11643 直接取用 Big5 的第一和第二級漢字區,
|
||||
作為 CNS11643 的第一和第二字面。</para>
|
||||
<para>目前現有的 CNS11643 七個字面的字型可以在
|
||||
<filename role="package">x11-fonts/intlfonts</filename> 中找到,
|
||||
有 16、24、40 點字等字體大小可以取用。</para>
|
||||
<table>
|
||||
<title>ISO-2022-CN 的規格 -1,2</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>字集</entry>
|
||||
<entry>十六進位</entry>
|
||||
<entry>圖形字符(ASCII)</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 1 字面</entry>
|
||||
<entry>1B 24 29 47</entry>
|
||||
<entry><ESC> $ ) G</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 2 字面</entry>
|
||||
<entry>1B 24 2A 48</entry>
|
||||
<entry><ESC> $ * H</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 3 字面</entry>
|
||||
<entry>1B 24 2B 49</entry>
|
||||
<entry><ESC> $ + I</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 4 字面</entry>
|
||||
<entry>1B 24 2B 4A</entry>
|
||||
<entry><ESC> $ + J</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 5 字面</entry>
|
||||
<entry>1B 24 2B 4B</entry>
|
||||
<entry><ESC> $ + K</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 6 字面</entry>
|
||||
<entry>1B 24 2B 4C</entry>
|
||||
<entry><ESC> $ + L</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS 11643-1992 第 7 字面</entry>
|
||||
<entry>1B 24 2B 4D</entry>
|
||||
<entry><ESC> $ + M</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>One-byte shift</entry>
|
||||
<entry>0F</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Two-byte shift</entry>
|
||||
<entry>0E</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<title>ISO-2022-CN 的規格 -3</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>移位種類</entry>
|
||||
<entry>十六進位</entry>
|
||||
<entry>字集</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SO</entry>
|
||||
<entry>0E</entry>
|
||||
<entry>CNS 11643-1992 第 1 字面</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SS2</entry>
|
||||
<entry>1B 4E</entry>
|
||||
<entry>CNS 11643-1992 第 2 字面</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SS3</entry>
|
||||
<entry>1B 4F</entry>
|
||||
<entry>CNS 11643-1992 第 3 至第 7 字面</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<title>台灣漢字字集規則</title>
|
||||
<tgroup cols="6">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>字集</entry>
|
||||
<entry>公佈時間</entry>
|
||||
<entry>第一級</entry>
|
||||
<entry>第二級</entry>
|
||||
<entry>附加漢字</entry>
|
||||
<entry>符號</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>CCCII</entry>
|
||||
<entry>1980</entry>
|
||||
<entry>75684</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Big5</entry>
|
||||
<entry>1984</entry>
|
||||
<entry>5401</entry>
|
||||
<entry>7652</entry>
|
||||
<entry></entry>
|
||||
<entry>441</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Big5_ETen</entry>
|
||||
<entry>1985</entry>
|
||||
<entry>5401</entry>
|
||||
<entry>7652</entry>
|
||||
<entry>7</entry>
|
||||
<entry>808</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS11643</entry>
|
||||
<entry>1992</entry>
|
||||
<entry>5401</entry>
|
||||
<entry>7650</entry>
|
||||
<entry>34976</entry>
|
||||
<entry>684</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<para>WWW: <ulink url="http://www.cns11643.gov.tw/">
|
||||
http://www.cns11643.gov.tw/</ulink></para>
|
||||
</sect1>
|
||||
<sect1 id="cccii">
|
||||
<title>CCCII</title>
|
||||
<para>CCCII(Chinese Character Code for Information Interchange:
|
||||
中文資訊交換碼),是精心設計的台灣字集規則之一。
|
||||
該規則是台灣的國字整理小組開發的。
|
||||
第一版頒布於1980年。</para>
|
||||
<para>CCCII總共有16層,每一層都有六個連在一起的94x94字面
|
||||
(共有94個字面)。
|
||||
這樣子就產生了一個94x94x94的字碼空間(皆為 0x21-0x7E 的編碼範圍)。
|
||||
字符按其種類收編於不同的層。</para>
|
||||
<para>CCCII的漢字先按部首,後按總筆劃數排列(昇序)。</para>
|
||||
<para>CCCII第一層用於基本漢字集合,包括 4808 常用漢字,
|
||||
17032 次常用漢字,20583 其他漢字。
|
||||
剩下的層用於第一層的異體字。</para>
|
||||
<para>最新的CCCII正式版頒布於1987年,共收編了53,940個字符。
|
||||
下版(1989年)將收編75,684個字符(44,167個正體字和31,517個異體字)。</para>
|
||||
<para>目前CCCII的實作可以分為:直接使用CCCII編碼,ISO-2022-CN,
|
||||
<link linkend="cccii-ft">CCCII-FT</link>,
|
||||
以及永麟中文碼等四種。</para>
|
||||
<table>
|
||||
<title>CCCII 第一層的構造</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>字面</entry>
|
||||
<entry>區</entry>
|
||||
<entry>字符</entry>
|
||||
<entry>內容</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>1</entry>
|
||||
<entry>0</entry>
|
||||
<entry>保留給控制碼</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>2</entry>
|
||||
<entry>56</entry>
|
||||
<entry>數學符號</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>3</entry>
|
||||
<entry>94</entry>
|
||||
<entry>ASCII</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>4-10</entry>
|
||||
<entry>0</entry>
|
||||
<entry>未編排</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>11</entry>
|
||||
<entry>35</entry>
|
||||
<entry>中文標點符號</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>12-14</entry>
|
||||
<entry>214</entry>
|
||||
<entry>繁體部首</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>15</entry>
|
||||
<entry>78</entry>
|
||||
<entry>41中文數字, 37拼音符號, 4音調符號</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>16-67</entry>
|
||||
<entry>4808</entry>
|
||||
<entry>常用漢字(213021~21637E)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1-3</entry>
|
||||
<entry>68-64</entry>
|
||||
<entry>17032</entry>
|
||||
<entry>次常用漢字(216421~23607E)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3-6</entry>
|
||||
<entry>65-5</entry>
|
||||
<entry>20583</entry>
|
||||
<entry>其他漢字(236121-262543)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>6</entry>
|
||||
<entry>6-94</entry>
|
||||
<entry>0</entry>
|
||||
<entry>未編排</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</sect1>
|
||||
<sect1 id="euc-tw">
|
||||
<title>EUC-TW</title>
|
||||
<para>EUC-TW 將 CNS11643-1992 的 16 進位加上 0x8080。
|
||||
第二字面轉換 8E A2,第三字面轉換 8E A3,第四字面轉換 8E A4,
|
||||
第五字面轉換 8E A5,第五字面轉換 8E A6,第七字面轉換 8E A7。</para>
|
||||
<table>
|
||||
<title>10月18日</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>編碼</entry>
|
||||
<entry>表示法</entry>
|
||||
<entry>解釋</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>CCCII</entry>
|
||||
<entry>21 23 31 21 23 30 21 43 5B 21 23 31 21 23 38 21 42 73</entry>
|
||||
<entry>212331:1 212330:0 21435B:月 212331:1 212338:8 214273:日</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Big5</entry>
|
||||
<entry>31 30 A4 EB 31 38 A4 E9</entry>
|
||||
<entry>31:1 30:0 A4EB:月 31:1 38:8 A4E9:日</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CNS11643-1992</entry>
|
||||
<entry>1B 24 29 47 31 30 0E 45 4C 0F 31 38 0E 45 4A 0F</entry>
|
||||
<entry>1B242947:(第一字面) 31:1 30:0 0E:(漢字) 454C:月 0F:(ASCII) 31:1 38:8 0E:(漢字) 454A:日 0F:(結束)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>EUC-TW</entry>
|
||||
<entry>31 30 C5 CC 31 38 C5 CA</entry>
|
||||
<entry>31:1 30:0 C5CC:月 31:1 38:8 C5CA:日</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gb-code">
|
||||
<title>GB</title>
|
||||
<para>在中國,中文信息編碼由政府負責制定並監督實施。
|
||||
這是為了保證對於所有的系統中文的編碼都是一致的,能夠互相進行操作。
|
||||
從計算機的應用開始,已經頒布了多種中文信息編碼標準,
|
||||
常用的是 GB2312-1980,GB12345,GB13000(GBK),以及最新標準 18030。
|
||||
值得一提的是,最新的 GB18030 標準將要作為強制標準實行,所有不支持
|
||||
GB18030 標準的軟體將不能作為產品的出售。</para>
|
||||
<para>從 GB2312-1980 編碼開始,漢字都是採用雙字節編碼。
|
||||
為了與系統中基本的 ASCII 字符集區分開,
|
||||
所有漢字編碼的每個字節的第一位元都是1。例如:"啊" 字的編碼為
|
||||
0xB0A1。</para>
|
||||
<table>
|
||||
<title>GB 的漢字編碼規則</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>編碼</entry>
|
||||
<entry>第一個字節</entry>
|
||||
<entry>第二個字節</entry>
|
||||
<entry>第三個字節</entry>
|
||||
<entry>第四個字節</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>GB2312</entry>
|
||||
<entry>0xB0 - 0xF7</entry>
|
||||
<entry>0xA0 - 0xFE</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GBK</entry>
|
||||
<entry>0x81 - 0xFE</entry>
|
||||
<entry>0x40 - 0xFE</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GB18030 的雙字節</entry>
|
||||
<entry>0x81 - 0xFE</entry>
|
||||
<entry>0x40 - 0x7E, 0x80 - 0xFE</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>GB18030 的四字節</entry>
|
||||
<entry>0x81 - 0xFE</entry>
|
||||
<entry>0x30 - 0x39</entry>
|
||||
<entry>0x81 - 0xFE</entry>
|
||||
<entry>0x30 - 0x39</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="iso10646">
|
||||
<title>Unicode/ISO 10646 </title>
|
||||
<para>Unicode (Universal Multiple Octet Coded Character Set),
|
||||
Unicode 國際標準組織於1984年4月成立
|
||||
IOS / IEC JTC1 / SC2 / WG2工作組,針對各國文字、
|
||||
符號進行統一性編碼,1991年美國跨國公司成立Unicode Consortium,
|
||||
並於1991年10月與WG2達成協議,採用同一編碼字集 。
|
||||
目前Unicode是採用16 bit之編碼架構,其字集內容與ISO 10646之
|
||||
BMP(Basic Multilingual Plane)相同。</para>
|
||||
<para>Unicode (Unicode Consortium)並於1992年6月通過
|
||||
DIS(Draft International Standard),目前版本為Unicode v2.0
|
||||
於1996年公佈, 內容包含符號6811、 漢字20902、韓文拼音11172、
|
||||
造字區6400,保留20249共65534個碼位 。</para>
|
||||
<para>
|
||||
目前碼位空間為 U+0000 到 U+10FFFF,共有
|
||||
1,114,112 個空間。</para>
|
||||
<para>Unihan3.2 包含超過七萬個 CJK 字。</para>
|
||||
<para>ISO 10646 HK WWW: <ulink url="http://www.iso10646hk.net/">
|
||||
http://www.iso10646hk.net/</ulink></para>
|
||||
<para>WWW: <ulink url="http://www.unicode.org/">
|
||||
http://www.unicode.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="basic">
|
||||
<title>基本中文環境的要件</title>
|
||||
<para>先讓我們一起來想一想,
|
||||
一個基礎中文平台要能夠做到那些事情,
|
||||
不妨就以編輯一份文件為例吧(像我現在在這邊寫稿一樣),
|
||||
我們希望開啟的程式可以有友善的介面,有中文的選單跟說明(中文訊息),
|
||||
還要有慣用的中文輸入法可以把中文打進去(輸入),
|
||||
打字進去以後必須可以看到輸入的結果(顯示),
|
||||
打字出錯了還要可以修改才行,必要的時後還得可以改變字型等等的(處理),
|
||||
文章打完了,要能夠順利的把結果印出來(列印);
|
||||
從這一個例子裡面我們就可以歸納出一個基本中文環境,
|
||||
應該要可以做到下面這幾件事情: </para>
|
||||
<itemizedlist>
|
||||
<listitem><para>中文的訊息</para></listitem>
|
||||
<listitem><para>中文的顯示</para></listitem>
|
||||
<listitem><para>中文的輸入</para></listitem>
|
||||
<listitem><para>中文的列印</para></listitem>
|
||||
<listitem><para>中文的處理</para></listitem>
|
||||
</itemizedlist>
|
||||
<para> 上面的列表就是我們認為一個基本中文環境所要滿足的要件,
|
||||
也是我們在評估一個系統中文支援優劣時所用的基準,
|
||||
其實所謂的"中文化",代表的就是在作為基礎的英文版作業系統上面,
|
||||
做出修正的工作,目的不外是要能夠滿足上面所提到的這些要件罷了,
|
||||
這個列表的順序剛好是依照程式設計加以支援的困難程度排出來的,
|
||||
順序是從簡單到困難;提供中文的訊息跟介面所牽涉到的大多只是翻譯的工作,
|
||||
最為簡單,在顯示時要考慮到字型的搭配問題,
|
||||
在輸入時要有一個程式之間共用的輸入介面,這些就比較困難,
|
||||
而列印不只要作到應用程式跟列印伺服程式之間的整合,
|
||||
還需要有產生大點數美觀字體的能力,這件工作牽涉的問題更加複雜了,
|
||||
這幾點裡面要讓應用程式處理中文是最困難的一部分,
|
||||
例如中文正規表示法、中文字串搜尋等等,都是目前還難以解決的課題。</para>
|
||||
<para> 那麼,在目前的 FreeBSD 環境底下,
|
||||
要用甚麼方法才可以讓系統支援上面提到的這些基本要件呢? </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="i18n-l10n">
|
||||
<title>國際化與中文化</title>
|
||||
<para>要讓系統支援中文,可能的解決方案不出三種,
|
||||
一是使用外掛式的中文系統,二是撰寫獨立的中文程式,
|
||||
三是利用系統上提供的國際化架構來支援。所謂的外掛式中文環境,
|
||||
指的是如同 DOS 底下的倚天中文或者 Windows 底下的雙橋中文這樣的系統,
|
||||
在 FreeBSD 系統底下,外掛式的中文環境可以藉著 LD_PRELOAD
|
||||
的機制來達成,只要設定 LD_PRELOAD 這個環境變數,
|
||||
適時的指到提供中文支援的動態函式庫去,就可以在程式執行時,
|
||||
動態的用支援中文的函式來替換掉原本不支援中文的函式,
|
||||
結果就可以讓不支援中文的程式變得可以顯示中文跟接受中文輸入了,
|
||||
例如 <application>xa+cv</application> 或者是在
|
||||
<application>TurboLinux</application> 裡面使用的 <application>
|
||||
zhWinPro</application> 都是屬於這類的程式。
|
||||
利用這種方式來提供中文的支援很簡單,很靈活,
|
||||
也不需要去修改程式的原始碼並重新編譯,
|
||||
可是這個方法卻沒辦法讓應用程式對中文作正確的"處理",
|
||||
常見的例子是雖然加上了外掛的中文系統,
|
||||
可是編輯文字時在中文字上面按一次刪除鍵卻還是只能刪除半個中文,
|
||||
這是因為在應用程式內部仍然是把一個中文字當成兩個英文字來看待,
|
||||
而這顯然是不正確的,此外這個方式也不支援跟函式庫作靜態連結的程式,
|
||||
還控會造成系統的不穩定,因此大家已經理解到這個方式無法解決根本問題,
|
||||
漸漸的捨棄這種外掛的方式,而用其他的方法提供中文支援了。 </para>
|
||||
<para>第二種方式是修改程式,直接讓每個程式都支援中文的使用,
|
||||
這種是最簡單也是最困難的方法,說它簡單,因為這件工作很直接,
|
||||
FreeBSD 底下的程式又大多數都可以拿到程式的原始碼,
|
||||
只要對這些原始碼作修正,加入支援中文的部份,就可以支援中文的使用囉,
|
||||
例如很多人使用的中文 <application>cpine</application>
|
||||
郵件程式就是用英文版 <application>pine</application> 的原始碼改出來的,
|
||||
其他如 <application>cxterm</application> 程式或者支援多種語言的
|
||||
<application>emacs</application>
|
||||
等等程式都是由應用程式自行提供中文支援的,
|
||||
這些程式對中文的支援很好,也都受到了大家的歡迎愛用,可是,
|
||||
使用者一旦離開這些有提供中文支援的程式以後就無法用中文了,
|
||||
一個 FreeBSD 套件少說有五六百個程式套件,
|
||||
想要全面的中文化,必須要一個一個完整的對這些程式做出修改才行,
|
||||
這件工作在人力跟物力上都會是一個天文數字的投資,是不可能的事情,
|
||||
所以我們前面說這也是最困難的方法 :) 況且,因為編碼系統不一樣,
|
||||
這些程式拿到日本就要改一次日文版,拿到韓國也要再改一次韓文版,
|
||||
這種作法會使得資源重複浪費的部份十分嚴重,由此可見,
|
||||
靠獨立的程式來提供中文環境並不是個聰明的作法,
|
||||
必須要有更好的方式才行。</para>
|
||||
<para> 那麼甚麼才是這個更好的方式呢?
|
||||
"國際化"可能是目前我們找得到的最好解答,
|
||||
國際化的英文名稱是 InternationalizatioN,這個英文單字的第一個字母
|
||||
I 與最後一個字母 N 之間有 18 個字母,所以也被簡稱為 I18N。
|
||||
I18N 是一種觀念跟目標,這個想法是要提供一個架構,
|
||||
讓同樣的程式碼可以適用在各種語文習慣跟編碼系統上面,
|
||||
程式設計人員只要利用這個架構的機制跟準則撰寫應用程式,
|
||||
就可以在不需重新編譯程式的情況下,自然的支援各式各樣的語言,
|
||||
不過為了要達成這樣的目標,作業系統必須提供一定程度的支援,
|
||||
特別是在各種的程式庫裡面都得有支援 I18N 的 設計才可以,
|
||||
這邊特別重要的就屬 C 程式庫以及 X 視窗系統的國際化設計了。
|
||||
過去,FreeBSD 上的 C 程式庫跟 X 對國際化的支援都不完整,
|
||||
整個基礎環境還不成熟,所以多數的程式並沒有照著 I18N 的標準來撰寫,
|
||||
導致中文化的問題困難重重,這個現象在這一年來已經有了大幅的改善,
|
||||
目前國際上大家寫程式的時候已經有支援 I18N 的普遍共識了,
|
||||
主流的程式也都漸漸提供了 I18N 的支援,利用標準的 FreeBSD
|
||||
國際化架構來支援中文還是要改程式,不過這個改法是國際的主流,
|
||||
也可以保證投資可以有最大的獲益,所以我們認為這才是建構中文環境的正途,
|
||||
在後續的文章裡面我們將會一一跟大家介紹目前 FreeBSD 底下 I18N
|
||||
環境的實作方法,以及設計 I18N 程式所該注意的事項。</para>
|
||||
<para>一般國際化架構設計的基本原則,
|
||||
是把程式處理會跟語文編碼相關的部份獨立出來,
|
||||
這些資料不只是編碼系統的定義,還包括該語文下的一些使用習慣,
|
||||
例如數字、日期、排序、貨幣的格式,以及翻譯的訊息等等...
|
||||
這些跟語文環境有相關的資料,我們稱之為 "區域環境資料庫"
|
||||
(locale database,LOCALization Environment database),
|
||||
把這些資料分離出來以後,就可以定義一個跟語文編碼無關的介面,
|
||||
給程式設計師使用,讓程式設計人員在設計程式時不必考慮,
|
||||
對特定語文環境提供支援的細腹A寫出來的程式就可以不限於支援特定語言,
|
||||
而是在程式執行的時候才依使用者的選擇的區域環境 (locale)
|
||||
聯繫到不同的資料庫,進而提供該語文的支援。 </para>
|
||||
<para>I18N 只是提供可能用來支援中文的大架構,要能夠使用中文,
|
||||
還必須要在這個架構裡面加入對中文語文編碼的支援才可以,
|
||||
這個在國際化架構之下加入對某種特定語文支援的動作稱為"區域化",
|
||||
英文稱為 LocalizatioN,因為 L 跟 N 之間有 10 個英文字母,
|
||||
也常被簡稱為 L10N,一般的 "中文化"
|
||||
是泛指為應用程式加上中文支援的過程,不過我們這邊提到的中文化,
|
||||
事實上就是在國際化架構下面加入中文區域化支援的工作;
|
||||
就目前的FreeBSD 環境而言,
|
||||
當前在 FreeBSD 上用來提供中文支援的國際化架構可說是已經大致完備,
|
||||
底層程式庫的中文區域化工作也都大致完成了,
|
||||
在這個架構之上已經可以提供一個不錯的中文環境可以用了,說起來,
|
||||
我們能有今日的中文環境可用,實在要感謝這些國際性程式開發組織(XFree86)
|
||||
有心重視亞洲語系使用者的需求,此外,
|
||||
長久以來許許多多網路上自由軟體作者的貢獻也是功不可沒,
|
||||
正就是因為有這許多前人不計個人報酬的努力,
|
||||
我們才能享受當前的中文環境。 </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="chinese-trans">
|
||||
<title>可能的問題</title>
|
||||
<para>許多程式由於各式各樣的原因,
|
||||
並未考慮到輸入的資料可能是 non-ASCII 碼的問題。
|
||||
它往往假設了它所要處理的資料都是 ASCII 碼,更糟糕的是,當它遇到
|
||||
non-ASCII 碼時,常常假設它不存在,而將它的第八個位元截去!
|
||||
這是所謂的 8-bit clean 問題。</para>
|
||||
<para>例如,您的 <link linkend="telnet">telnet</link> 程式
|
||||
總是認為您輸入的都是七位元的 ASCII 碼。當您輸入中文時,
|
||||
每每將第八位元砍掉,所以都變成亂碼。</para>
|
||||
<para>網路上的通訊程式也常常只能傳輸七位元的資料。較早期的
|
||||
<application>sendmail</application> 程式就是惡名昭彰的例子。
|
||||
<application>sendmail</application> 只能接送含七位元的信件,
|
||||
導致我們在傳送中文信件時,必須採用各式各樣奇怪的
|
||||
<link linkend="procmail">編碼格式</link>
|
||||
(如 uuencode,base64,QP 等),這往往又為收信者帶來很大的困擾!
|
||||
(我常在想如果當初電子郵件的創造者能多一點點的遠見,
|
||||
我們今天就會少許多的問題!)</para>
|
||||
<para>在網路上這個問題顯得更為複雜。
|
||||
即使您和您的收信人的機器都已經安裝了可以處理中文信件的
|
||||
<application>sendmail</application> 程式
|
||||
,對方仍有可能收到亂碼信件。
|
||||
因為這封信在到達對方手中前可能經過好多部主機,
|
||||
如果其中一部機器的 <application>sendmail</application>
|
||||
將第八位元截去,事情就完了!
|
||||
對於 client/server 架構的程式,問題可能出在 client 端,
|
||||
也可能是在 server 端,或是雙方都有。</para>
|
||||
<para>除了無法處理 non-ASCII 碼資料的問題之外,
|
||||
應用程式無法辨識中文編碼也是一大問題。也就是,很多程式
|
||||
(即使能正確處理八位元的資料)都將一個中文字視為兩個獨立的位元組。
|
||||
這在許多情況下不會有什麼不好,但在某些場合下就顯得很糟!</para>
|
||||
<para>最顯然的例子,即使您能正確的輸入中文,可是當您按下倒退鍵
|
||||
(backspace)時,往往只倒後了一個位元組而將一個好好的中文字截成兩半,
|
||||
剩下的那半當然就成了亂碼。還有,
|
||||
文書編輯器可能在一個中文字中間換行而導致出現亂碼,
|
||||
或是將一行很長的中文句子當作一個很長的英文字母而不換行,
|
||||
使得畫面變得很難看。</para>
|
||||
<para>還有更糟的!某些中文字所含的特殊內碼對某些應用程式具有特別的意義,
|
||||
這導致程式遇到這些內碼時將產生嚴重的錯誤,或是當掉。</para>
|
||||
<para>下面將試著為這些問題提出一些解決之道,但是這仍是片面的,
|
||||
不完全的,而且不能令人滿意。
|
||||
也許只有當所有的軟體都能為中文量身打造時問題才可能真正的解決。</para>
|
||||
<para>話雖如此,愈來愈多的程式在設計上已經注意到國際化的問題,
|
||||
例如現在大部分主機的 <application>sendmail</application>
|
||||
程式都已經能正確處理 8-bit 的信件 ---
|
||||
因為不僅僅是傳輸中文信件需要 8-bit,
|
||||
現在很多的多媒體郵件也都需要用 8-bit 傳送。
|
||||
很多軟體已經完全不需修改,
|
||||
或者只要開啟一些特殊的選項,就能使用中文。
|
||||
同時也有愈來愈多人正在為軟體的中文化而努力。且讓我們拭目以待。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="locale">
|
||||
<title>什麼是 locale ?</title>
|
||||
<para>locale 是一組 C 程式語言處理自然語言(文字)的程式介面,
|
||||
也可以簡單的說,locale 就是一組 [地區性語言] 的資訊。
|
||||
由國家語言和各地習俗影響所決定的慣例,或代表一個地理區域的定義所組成,
|
||||
這些慣例包含文字、日期、數字、貨幣格式和排序等等。這代表著 locale 可讓程式的輸出可以直接反應地方區域性的文化。C 語言的 locale
|
||||
定義,分為下列各大類:</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>LC_ALL 代表所有的 Locale</para></listitem>
|
||||
<listitem><para>LC_CTYPE 字元定義 (包含字元分類與轉換規則)</para></listitem>
|
||||
<listitem><para>LC_MESSAGES 訊息顯示</para></listitem>
|
||||
<listitem><para>LC_TIME 時間格式</para></listitem>
|
||||
<listitem><para>LC_NUMERIC 數字格式</para></listitem>
|
||||
<listitem><para>LC_MONETARY 貨幣格式</para></listitem>
|
||||
<listitem><para>LC_COLLATE 字母順序與特殊字元比較</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>其中與一般使用者息息相關的,是字元定義 (LC_CTYPE) 與訊息顯示
|
||||
(LC_MESSAGES)。LC_CTYPE 直接關係到某些字元或內碼在目前的
|
||||
locale 下是否可列印?要如何轉換字碼?對應到哪一個字?....
|
||||
等等。LC_MESSAGES 則關係到軟體的訊息輸出是不是符合地域性,例如
|
||||
:我們需要的是中文。而一個真正完整支援 locale 系統,
|
||||
是當使用者在 shell prompt 下,直接設好環境變數後,
|
||||
則馬上就能切換到那個語言了。例如: </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>setenv LC_CTYPE zh_TW.Big5</userinput> </screen>
|
||||
<para>locale 命名規則:語言_地區名.字元編碼名稱</para>
|
||||
<para>設定 Locale 的字元定義為台灣地區的 Big5 繁體中文碼定義,
|
||||
有了正確的 locale 的定義後,使得任何地區的語文,只要在加入適當的
|
||||
locale data 之後,C Library 就能正確地處理軟體顯示訊息,
|
||||
而我們使用的 [中文] 當然也不例外,而目前中文使用的 locale data
|
||||
就是 zh_TW.Big5,代表的就是中文語系(zh)台灣地區(TW)
|
||||
使用Big5編碼系統(Big5)。 </para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,910 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.100
|
||||
-->
|
||||
|
||||
<chapter id="faq">
|
||||
<title>常見問題解答</title>
|
||||
|
||||
<sect1 id="anti-input">
|
||||
<title>為何我無法輸入中文?</title>
|
||||
<para>這個問題問得太籠統了!您是在什麼情況下不能輸入中文的?</para>
|
||||
<para>如果您是在 console 的 shell 下不能輸入中文,請參考
|
||||
<link linkend="shell">在 Shell 底下輸入中文</link>
|
||||
一小節的說明。</para>
|
||||
<para>如果您是在編輯器中不能輸入,可能您的編輯器無法支援中文。
|
||||
請參考 <link linkend="software">有用的中文軟體</link>
|
||||
一節安裝能支援中文的編輯器。
|
||||
如果是 <application>vi</application> 無法輸入中文請參考
|
||||
<link linkend="vi">輸入中文會顯示 /XX/XX?</link></para>
|
||||
<para>如果您是 <application>telnet</application>
|
||||
到別入的機器後不能輸入中文,那麼問題很可能在
|
||||
<application>telnet</application> 這支程式上。請參考
|
||||
<link linkend="telnet">telnet</link>
|
||||
一小節的說明。 </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="input-in-netscape">
|
||||
<title>如何在 Netscape 輸入中文? [OBSOLETE]</title>
|
||||
<para>安裝 <application>xcin25</application> 並設定好 XIM 即可。請參考
|
||||
<link linkend="xcin25">xcin25</link>
|
||||
一節的說明。不過如果 <application>netscape</application>
|
||||
是以 package 安裝的,可能沒辦法。 </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="chitex-cjk">
|
||||
<title>ChiTeX 與 CJK 有何不同? 可否同時安裝?</title>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<application>CJK</application> 的中文字形讀取尋找系統架構在
|
||||
<application>LaTeX</application> 的 NFSS 上,
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<application>ChiTeX</application> 的中文字形讀取尋找系統是獨立而效率高的系統
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<application>CJK</application> 可使用中文,日文,韓文;而
|
||||
<application>ChiTeX</application> 只對中文正體字(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<application>CJK</application> 只能用在
|
||||
<application>LaTeX</application> 上;而
|
||||
<application>ChiTeX</application> 可用在 plain
|
||||
<application>TeX</application> 與
|
||||
<application>LaTeX</application> 上。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<application>ChiTeX</application> 指令簡單但很有用。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<application>ChiTeX</application> 是接近真正中文
|
||||
<application>LaTeX</application> 的中文
|
||||
<application>LaTeX</application>。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
功能的不同...
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para><application>ChiTeX</application> 和
|
||||
<application>CJK</application> 應該是可以同時安裝的,但是
|
||||
<application>ChiTeX</application> 與
|
||||
<application>CJK</application> 所用的
|
||||
<application>ttf2pk</application> 如果同名字,可能有問題。
|
||||
解決的辦法是在各自起始的指令稿(shell script)中定義 $PATH
|
||||
變數,使其指向正確的 <application>ttf2pk</application> 位置。
|
||||
</para>
|
||||
<para> (感謝陳弘毅教授解答。) </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="rxvt-locale">
|
||||
<title>rxvt-2.7.3 為何是日文的?</title>
|
||||
<para>請參考<link linkend="rxvt">rxvt</link>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="speedup-xwin">
|
||||
<title>加快 X Win 的方法?</title>
|
||||
<para>用 "<command>startx - -deferglyphs 16</command>"
|
||||
進入 X 視窗系統試試看,這裡
|
||||
"<option>-deferglyphs 16</option>" 的參數會讓 X 延遲產生
|
||||
16bit 字型的時間,
|
||||
不在第一次載入字型的時候就全部一次產生,而在真正使用到字型
|
||||
的時候才產生,可以讓載入中文字型的時候不會 hang 住,可以加
|
||||
快中文字顯示的速度。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="netscape-color">
|
||||
<title>為何 Netscape 的圖示是黑白的? [OBSOLETE]</title>
|
||||
<para>
|
||||
當 <option>bpp</option> 設成 24 時,
|
||||
<application>Netscape</application>
|
||||
的圖示就會變成黑白,
|
||||
只要用 <option>bpp 16</option> 或是
|
||||
<option>bpp 32</option> 就會變成彩色了。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="ssh">
|
||||
<title>中文的 SSH client for windows?</title>
|
||||
<para><application>PuTTY</application> 現在有中文相容的版本出來了,
|
||||
推薦給大家,很小的檔案,只有 216 KB,此版中文正常。
|
||||
<application>PuTTY</application> 中文相容作者:&a.mhsin;,
|
||||
中文相容功能作者網頁: <ulink url="http://www.mhsin.org/putty/">
|
||||
http://www.mhsin.org/putty/</ulink>,這裡提供一個<ulink
|
||||
url="http://freebsd.sinica.edu.tw/~statue/putty.exe">下載點</ulink>。</para>
|
||||
<para>在 0.52 版的 putty 只需要調整一下設定就可以輸入中文了。
|
||||
Change Settings -> Window -> Appearance -> 的
|
||||
Set the font used in the terminal window 點 Change 後
|
||||
將字型選擇細明體或是標楷體的中文字型,並把字集選擇
|
||||
CHINESE_BIG5,這樣子就可以輸入中文囉。</para>
|
||||
<para>使用新版PuTTY時請記得把Window-->Appearance裡的cursor appearance改成
|
||||
Underline,避免預設的塊狀游標在重繪時會把游標所在的中文字切開。</para>
|
||||
<para>筆者通常還會把 Terminal 裡面的 <option>Enable blinking text</option>
|
||||
來支援閃爍字,以及把 Keyboard 裡面的 <option>The Backspace key</option>
|
||||
改成 <option>Control-H</option> 來使 BackSpace 有效用。</para>
|
||||
<para>Putty WWW: <ulink url="http://www.chiark.greenend.org.uk/~sgtatham/putty/">
|
||||
http://www.chiark.greenend.org.uk/~sgtatham/putty/</ulink>。</para>
|
||||
<para>要不然也可以到 <ulink url="http://www.ssh.com/products/ssh/download.cfm">
|
||||
http://www.ssh.com/products/ssh/download.cfm</ulink> 抓取
|
||||
<application>SSHWinClient-3.0.0.exe</application>,
|
||||
此版中文也正常,功能也比 <application>Putty</application>
|
||||
多很多,不過檔案大了點,約 6.37MB,這裡提供一個
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~statue/SSHWinClient-3.0.0.exe">下載點</ulink>。</para>
|
||||
<para>SSHWinClient WWW: <ulink url="http://www.ssh.com/">
|
||||
http://www.ssh.com/</ulink>。</para>
|
||||
<para>Chinese Putty WWW: <ulink url="http://mhsin.org/putty/">
|
||||
http://mhsin.org/putty/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="input-in-ftp">
|
||||
<title>在 FTP 中輸入中文?</title>
|
||||
<para>在終端機底下請試試用 <link linkend="ncftp3">ftp/ncftp3</link>,
|
||||
如果在 X 底下建議使用 <link linkend="iglooftp">ftp/IglooFTP</link>
|
||||
畫面和使用方式保證愛不釋手。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="oracle8i">
|
||||
<title>Oracle8i 沒辦法使用中文?</title>
|
||||
<para>在環境變數中設定 nls_lang</para>
|
||||
<programlisting>
|
||||
<!--export nls_lang=American_America.ZHT16BIG5-->
|
||||
export nls_lang="traditional chinese"</programlisting>
|
||||
<para>或是設定 NLS_LANG 為 TRADITIONAL CHINESE_TAIWAN.ZHT16BIG5,
|
||||
這兩種方法都有人提出來,不過筆者沒有實際測試過。</para>
|
||||
<para>WWW: <ulink url="http://www.oracle.com.tw/">
|
||||
http://www.orcale.com.tw/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="oracle9i">
|
||||
<title>安裝 Oracle9i 出現亂碼?</title>
|
||||
<para>by tommy@teatime.com.tw</para>
|
||||
<para>Oracle 9i 內的 JAVA 字型設定有點問題,
|
||||
安裝環境都設為英文就可以安裝了。</para>
|
||||
<para>如果一定要看到中文,就把下面這個檔案的內容改一改再裝:</para>
|
||||
<programlisting>
|
||||
Disk1/stage/Components/oracle.swd.jre/1.1.8.0.0/1/ \
|
||||
DataFiles/Expanded/linux/lib/font.properties.zh_TW_Big5</programlisting>
|
||||
<para>或是:</para>
|
||||
<programlisting>
|
||||
Disk1/stage/Components/oracle.swd.jre/1.3.1.0.0/1/ \
|
||||
DataFiles/Expanded/jre/linux/libfont.properties.zh</programlisting>
|
||||
<para>裡面的 1.1.8.0.0 或是 1.3.1.0.0 要根據您所安裝的
|
||||
jsdk 內附的版本,並且把 big5 那幾行改為:</para>
|
||||
<programlisting>
|
||||
-default-ming-medium-r-normal--*-%d-*-*-c-*-big5-0</programlisting>
|
||||
<para>就可以了。</para>
|
||||
<para>或是直該修改 $JAVA_HOME/jre/lib/font.properties
|
||||
也可以,感謝 jsona laio <freeonfair@yahoo.co.uk>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="wuftp">
|
||||
<title>wu-ftp 無法上傳中文檔名的檔案?</title>
|
||||
<para>為什麼匿名者無法上傳中文檔名的檔案,但卻可上傳英文檔名的檔案?</para>
|
||||
<para>我想是您在 ftpaccess 設定檔中設定了 patch-filter 了。
|
||||
只要把以下的設定註解起來,應該就可以傳中文檔名的檔案了。</para>
|
||||
<programlisting>
|
||||
# path-filter...
|
||||
path-filter anonymous /etc/pathmsg ^[-A-Za-z0-9_\.]*$ ^\. ^-
|
||||
path-filter guest /etc/pathmsg ^[-A-Za-z0-9_\.]*$ ^\. ^-</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="kdm">
|
||||
<title>kdm 登入畫面是亂碼?</title>
|
||||
<para><filename>/usr/local/share/config/kdmrc</filename> 檔案,
|
||||
找到 font 相關設定,數字設定第三個欄位的 0 改成 big5 即可。ex:</para>
|
||||
<programlisting>
|
||||
FailFont=helvetica,12,5,big5,75,0
|
||||
GreetFont=charter,24,5,big5,50,0
|
||||
StdFont=helvetica,12,5,big5,50,0</programlisting>
|
||||
<para>順便看一下 [Locale] 區段,要正常顯示中文,要補上:</para>
|
||||
<programlisting>
|
||||
Country=tw
|
||||
Language=zh_TW.Big5</programlisting>
|
||||
<para>另外,中文的環境設定要在 <filename>~/.xsession</filename>
|
||||
裡面設定,而不是在 <filename>~/.cshrc</filename>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="vi">
|
||||
<title>vi 輸入中文會顯示 /XX/XX?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias vi 'env LC_CTYPE=en_US.ISO_8859-1 vi'</programlisting>
|
||||
<para>或是直接改用 vim6,會有更多的功能與支援。</para>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="write">
|
||||
<title>write 無法送中文訊息?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias write 'env LC_CTYPE=en_US.ISO_8859-1 write'</programlisting>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="talk">
|
||||
<title>talk 無法送中文訊息?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias talk 'env LC_CTYPE=en_US.ISO_8859-1 talk'</programlisting>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="wall">
|
||||
<title>wall 無法送中文訊息?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias wall 'env LC_CTYPE=en_US.ISO_8859-1 wall'</programlisting>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="finger">
|
||||
<title>finger 無法看到中文project?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias finger 'env LC_CTYPE=en_US.ISO_8859-1 finger'</programlisting>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mail">
|
||||
<title>mail 無法看到中文?</title>
|
||||
<para>這通常都是設定了 LC_CTYPE 為 zh_TW.Big5 或是沒設定 LC_CTYPE
|
||||
才會發生的問題,在 <filename>~/.cshrc</filename> 中加上下面的
|
||||
alias 即可:</para>
|
||||
<programlisting>
|
||||
alias mail 'env LC_CTYPE=en_US.ISO_8859-1 mail''</programlisting>
|
||||
<para>請參考 <link linkend="iso8859-1">ISO8859-1</link> 一節。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="xml">
|
||||
<title>xml 是否具有處理中文的能力?</title>
|
||||
<para>請參考以下的網址:</para>
|
||||
<para>WWW: <ulink url="http://www.ascc.net/xml/zh/big5/">
|
||||
Chinese XML Now</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="rm-i">
|
||||
<title>如何刪除以中文命名的檔案?</title>
|
||||
<para>當遇到不知名的亂碼命名檔案時,可以用
|
||||
<command>rm -i *</command> 來刪除檔案,
|
||||
它會每一個檔案都詢問您是否要刪除。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="x-win32">
|
||||
<title>X-win32 如何安裝中文字型?</title>
|
||||
<para>通常筆者都會使用 kcfonts,因為跟預設的系統比較合。</para>
|
||||
<para>首先在 <filename>chinese/kcfonts</filename> 安裝好後,
|
||||
將 <filename>/usr/X11R6/lib/X11/fonts/local/</filename> 底下的檔案,
|
||||
全都搬移到 <filename>C:\Program Files\StarNet\X-Win32 5.1\Lib\Fonts\
|
||||
</filename> 底下,然後用 <option>Font -> Add... ->
|
||||
local\</option>,接著 <option>Make FONTS.DIR</option>,
|
||||
並 <option>Edit Alias File...</option>:</para>
|
||||
<programlisting>
|
||||
kc12x24 -kc-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
|
||||
kc15f -kc-fixed-medium-r-normal--16-160-72-72-c-160-big5-0
|
||||
kc24f -kc-fixed-medium-r-normal--24-240-100-100-c-240-big5-0
|
||||
kc8x15 -kc-fixed-medium-r-normal--15-170-100-100-c-80-iso8859-1
|
||||
taipei16 -kc-fixed-medium-r-normal--16-160-72-72-c-160-big5-0
|
||||
taipei24 -kc-fixed-medium-r-normal--24-240-100-100-c-240-big5-0</programlisting>
|
||||
<para>或是用 <filename>ports/x11-fonts/getbdf</filename> ,<command>
|
||||
getbdf -font "-dynalab-mingliu-medium-r-normal--16-*-*-*-c-*-big5-0"
|
||||
> mingliu16.bdf</command> 來產生 16pt 的字型,
|
||||
然後依序產生所需要用的字型。</para>
|
||||
<para>在 Windows 底下也可以抓取 <filename>ttf2bdf.exe</filename>,將
|
||||
<filename>C:\Windows\Fonts\mingliu.ttc</filename> 轉成 bdf,
|
||||
然後依照上面的方法也是可以使用的。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="www">
|
||||
<title>網頁亂碼?</title>
|
||||
<para>如果是網頁內容,請在網頁的最前面加上:</para>
|
||||
<programlisting>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
|
||||
</programlisting>
|
||||
<para>在網頁中設定後,重讀應該就正常了,如果還是不正常就檢察
|
||||
<filename>httpd.conf</filename> 看是否有下面這行:
|
||||
<option>AddDefaultCharset ISO-8859-1</option>,
|
||||
這行設定會讓瀏覽器不會根據網頁中的語言設定而判斷編碼方法,
|
||||
只要把這行註解掉就可以了。</para>
|
||||
<para>如果是 URL 列中文變亂碼,這是正常的,您可以用 perl 來編碼:</para>
|
||||
<programlisting>
|
||||
$string =~ s/([^0-9A-Za-z])/sprintf("%%%02X",ord($1))/ge;</programlisting>
|
||||
<para>或是用 perl 來解碼:</para>
|
||||
<programlisting>
|
||||
$string =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/chr hex $1/ge;</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="vnc">
|
||||
<title>vnc 抓 XFree86 的中文問題?</title>
|
||||
<para>by nestlin (nestlin.bbs@nestlin.Dorm13.NCTU.edu.tw)</para>
|
||||
<para>Q: 請教一下,我在 w2k 中執行 vnc 去抓 bsd 的 xwin 3.3.6 版,
|
||||
是可以抓進來,但沒有中文,但如果我的在 bsd 上頭使用 startx
|
||||
跑 xwin 時中文確是正常的,請問我要如何解決 vnc 中 中文的問題。</para>
|
||||
<para>A: 如果是 GNOME2 的軟體,中文不會有問題,
|
||||
但是如果是傳統 XLFD 吃字的話,可以參考以下的安裝過程:</para>
|
||||
<para>安裝 <filename role="package">net/vnc</filename>。</para>
|
||||
<para>接著修改 <filename>/usr/X11R6/bin/vncserver</filename>:</para>
|
||||
<programlisting>
|
||||
--- vncserver.orig Fri Jan 4 15:45:23 2002
|
||||
+++ vncserver Fri Jan 4 16:07:47 2002
|
||||
@@ -149,6 +149,7 @@
|
||||
|
||||
# Add font path and color database stuff here, e.g.:
|
||||
#
|
||||
+$cmd .= " -fp /usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/local/";
|
||||
# $cmd .= " -fp /usr/lib/X11/fonts/misc/,/usr/lib/X11/fonts/75dpi/";
|
||||
# $cmd .= " -co /usr/lib/X11/rgb";
|
||||
#</programlisting>
|
||||
<para>接著就可以啟動囉。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>vncserver :1</userinput> (啟動)
|
||||
|
||||
You will require a password to access your desktops.
|
||||
|
||||
Password: <userinput>passwd</userinput>
|
||||
Verify: <userinput>passwd</userinput>
|
||||
xauth: creating new authority file /root/.Xauthority
|
||||
|
||||
New 'X' desktop is statue2.elife.idv.tw:1
|
||||
|
||||
Creating default startup script /root/.vnc/xstartup
|
||||
Starting applications specified in /root/.vnc/xstartup
|
||||
Log file is /root/.vnc/statue2.elife.idv.tw:1.log
|
||||
&prompt.root; <userinput>vncpasswd</userinput> (換密碼)
|
||||
Password: <userinput>passwd</userinput>
|
||||
Verify: <userinput>passwd</userinput>
|
||||
&prompt.root; <userinput>ps -aux |grep Xvnc</userinput> (檢查狀態)
|
||||
root 7103 0.9 0.7 5652 5288 p1 I 3:36下午 0:42.89 Xvnc :1 -desktop
|
||||
&prompt.root; <userinput>vncserver -kill :1</userinput> (終止)
|
||||
</screen>
|
||||
<para>vncviewer 則是以 statue2.elife.idv.tw:1 來連線。</para>
|
||||
<para>如果不想修改 vncserver 或是想以其他的 window Manager 來啟動,
|
||||
那麼就要修改 <filename>~/.vnc/xstartup</filename>:</para>
|
||||
<programlisting>
|
||||
xset +fp /usr/X11R6/lib/X11/fonts/misc/
|
||||
xset +fp /usr/X11R6/lib/X11/fonts/100dpi/
|
||||
xset +fp /usr/X11R6/lib/X11/fonts/local/
|
||||
xcin2.5 &
|
||||
icewm</programlisting>
|
||||
<para>由於 vnc 是由 XFree86-3 改的,所以現在我還不知道該怎麼使用 TTF。</para>
|
||||
<para>VNC 是一個很好用的 Remote Desktop Controller,但其 X version 是改自
|
||||
XFree86 3.3.2,所以沒有支援 TrueType 字型。</para>
|
||||
<para>TridiaVNC 是由 Tridia 公司發展,延續 vnc 的開發,為 vnc 加上許多功能,
|
||||
如提供更多的壓縮方式,及加入對 xtt 的 TrueType 字型支援。(XFree86-4
|
||||
內含 xtt module,故 TridiaVNC 可以直接使用 XFree86-4 的 TrueType 字型)
|
||||
</para>
|
||||
<para>安裝 <filename role="package">net/tridiavnc</filename>。</para>
|
||||
<para>若系統中已經有 xtt 字型目錄,請於 ~/.vnc/xstart 內加入:</para>
|
||||
<programlisting>
|
||||
xset +fp /usr/X11R6/lib/X11/fonts/TrueType</programlisting>
|
||||
<para>若無,請安裝 ports 裡的 TrueType 字型。</para>
|
||||
<para>VNC 裡面怎麼打中文?只要Ctrl+Space不要被 Windows 吃了就好了,
|
||||
或是改變 VNC 內的 xin2.5 切換中文的熱鍵也可以。</para>
|
||||
<figure>
|
||||
<title>vnc snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/vnc" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>RealVNC WWW: <ulink url="http://www.realvnc.com">
|
||||
http://www.realvnc.com</ulink></para>
|
||||
<para>tridiaVNC WWW: <ulink url="http://www.tridiavnc.com">
|
||||
http://www.tridiavnc.com</ulink></para>
|
||||
<para>tightVNC WWW: <ulink url="http://www.tightvnc.com">
|
||||
http://www.tightvnc.com</ulink></para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cccii-ft">
|
||||
<title>CCCII-FT</title>
|
||||
<para>因為基於CCCII的繁體中文內碼一直未定出適當的標準,
|
||||
故 changcs 參考了一些資料(CCCII手冊、EUC-TW內碼),
|
||||
以下提出一個基於CCCII的繁體字專用中文內碼(暫稱為EUC-CCCII-FT)。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/cccii-ft</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput>
|
||||
|
||||
Add the following lines into your ~/.Xdefaults:
|
||||
|
||||
whterm*font: 12x24
|
||||
whterm*kanjiMode: euc
|
||||
whterm*cccii21Font: cccii21Font
|
||||
whterm*cccii22Font: cccii22Font
|
||||
whterm*cccii23Font: cccii23Font
|
||||
whterm*cccii24Font: cccii24Font
|
||||
whterm*cccii25Font: cccii25Font
|
||||
whterm*cccii26Font: cccii26Font
|
||||
|
||||
&prompt.root; <userinput>xset +fp /usr/X11R6/lib/X11/fonts/cccii/</userinput>
|
||||
&prompt.root; <userinput>xlsfonts | grep cccii</userinput>
|
||||
&prompt.root; <userinput>xrdb -load ~/.Xdefaults</userinput>
|
||||
&prompt.root; <userinput>whterm &</userinput>
|
||||
&prompt.root; <userinput>cat /usr/X11R6/share/cccii/test_file</userinput></screen>
|
||||
<figure>
|
||||
<title>cccii snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/cccii" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://santos.ee.ntu.edu.tw/~changcs/whterm/whterm.html">
|
||||
http://santos.ee.ntu.edu.tw/~changcs/whterm/whterm.html</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="default-font">
|
||||
<title>如何更改 X 的預設中文字體?</title>
|
||||
<para>在安裝完 X 後,選單,顯示都是文鼎中楷,這對用慣了細明體的人,
|
||||
有著莫大的不便,但是把系統字型全都換成 Ming 體後,也就是文鼎宋體後,
|
||||
英文字體的變化就會變少了,所以應該有簡單的方式可以取代。</para>
|
||||
<para>後來看到 &a.edwardlee;
|
||||
的一篇文章,才知道原來 X 預設抓字型的時候,是以 fonts.dir
|
||||
的內容來排序的,由於文鼎的 foundry name 都是 Arphic,所以就看下一個
|
||||
family name,
|
||||
AR PL KaitiM Big5 比 AR PL Mingti2L Big5 還前面,所以這就是為什麼,
|
||||
一般都會抓到楷體的原因。所以就會去改變字型的 family name,
|
||||
來治療這個問題。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/X11R6/lib/X11/fonts/TrueType</userinput>
|
||||
&prompt.root; <userinput>perl -pi -e 's/Kai/Nai/g' fonts.alias fonts.dir fonts.scale</userinput></screen>
|
||||
<para>但是這樣子的做法會讓 KaitiM 的字型在整合上會出現許多問題,
|
||||
如果都不會使用到 KaitiM 的使用者才建議如此做。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gdk-warning">
|
||||
<title>Gdk-WARNING **: BIG5-0</title>
|
||||
<para>會出現這樣子的訊息通常都是沒設定好 <filename>~/.gtkrc</filename>,
|
||||
請參考 <link linkend="gnome">GNOME 程式的中文支援</link>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="unzip">
|
||||
<title>unzip 解開中文檔名變亂碼?</title>
|
||||
<para>在 Windows 中用 Winzip 壓縮中文檔名的檔案,
|
||||
抓到 FreeBSD 底下 unzip 會變成亂碼。</para>
|
||||
<para>安裝 <filename role="package">chinese/unzip</filename>。</para>
|
||||
<para>或是利用下面有個 leeym 大大的 patch:</para>
|
||||
<programlisting>
|
||||
--- unzpriv.h.orig Thu Apr 10 02:13:13 2003
|
||||
+++ unzpriv.h Thu Apr 10 02:24:23 2003
|
||||
@@ -2333,7 +2333,7 @@
|
||||
# endif
|
||||
# define _OEM_INTERN(str1) {register uch *p;\
|
||||
for (p=(uch *)(str1); *p; p++)\
|
||||
- *p = native((*p & 0x80) ? oem2iso[*p & 0x7f] : *p);}
|
||||
+ *p = native(/*(*p & 0x80) ? oem2iso[*p & 0x7f] :*/ *p);}
|
||||
# endif
|
||||
#endif
|
||||
</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="squid">
|
||||
<title>squid 瀏覽 ftp 與 gopher 中文亂碼?</title>
|
||||
<para>by KTH.bbs&alway.twbbs.org</para>
|
||||
<para>原本學校使用 Squid 2.1,透過它瀏覽 ftp 站台與
|
||||
gopher 站台訊息不會有亂碼出現,後來多了一台 2.4STABLEX
|
||||
以後,發現都會有亂碼的產生,稍微追蹤了一下程式,
|
||||
原來問題出在 2.4x 以後會將 >=0x7f 與 <=0x1f 的字元編碼成
|
||||
&#%3d 的格式,因此在不影響穩定度的情況下,
|
||||
就乾脆把這一段程式給註解掉了,這樣就能解決中文亂碼問題了,
|
||||
用瀏覽器瀏覽起來真的蠻舒服的 ^^</para>
|
||||
<programlisting>
|
||||
--- lib/html_quote.c.orig Wed Jun 5 16:02:30 2002
|
||||
+++ lib/html_quote.c Wed Jun 5 16:03:07 2002
|
||||
@@ -114,11 +114,13 @@
|
||||
* sure all 8-bit characters are encoded to protect from buggy
|
||||
* clients
|
||||
*/
|
||||
+#if 0
|
||||
if (!escape && (ch <= 0x1F || ch >= 0x7f) && ch != '\n' && ch != '\r' && ch != '\t') {
|
||||
static char dec_encoded[7];
|
||||
snprintf(dec_encoded, sizeof dec_encoded, "&#%3d;", (int) ch);
|
||||
escape = dec_encoded;
|
||||
}
|
||||
+#endif
|
||||
if (escape) {
|
||||
/* Ok, An escaped form was found above. Use it */
|
||||
strncpy(dst, escape, 6);</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="apache2">
|
||||
<title>apache2 預設顯示中文網頁</title>
|
||||
<para>apache2 的httpd.conf裡面有一行設定:</para>
|
||||
<programlisting>
|
||||
AddDefaultCharset ISO-8859-1</programlisting>
|
||||
<para>這一行設定導致瀏覽器不會根據網頁裡面的語言設定而判斷編碼方法,
|
||||
只要把這行註解掉就可以正常了。</para>
|
||||
<para>如果要預設為 Big5 編碼,也可以改為:</para>
|
||||
<programlisting>
|
||||
AddDefaultCharset Big5</programlisting>
|
||||
<para>不過如果有使用者的網頁並非 Big5 編碼,
|
||||
這樣子的設定可能會造成困擾,
|
||||
不如註解掉由使用者自己去寫以下的標頭更為合適:</para>
|
||||
<programlisting>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=big5"></programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="url">
|
||||
<title>網址列不能使用中文檔名?</title>
|
||||
<para>網址列不能使用中文,可能是 IE 的預設值造成的。
|
||||
按造下面的步驟修改看看:</para>
|
||||
<programlisting>工具(T) -> 網際網路選項(O) -> 進階</programlisting>
|
||||
<para>裡面有個 <option>永遠將 URL 傳送成 UTF-8 (需要重新啟動)</option>
|
||||
的選項,把勾取消後,按確定並將 IE 關掉重開。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="wget">
|
||||
<title>wget 中文檔名變亂碼</title>
|
||||
<para>中文檔名在平常的情況下會被編碼,
|
||||
但是在 <option>--cut-dirs</option> 時又是正常的,
|
||||
那就大家用 <option>--cut-dirs</option>,
|
||||
或是使用 <filename>outta-port/wget</filename> 吧</para>
|
||||
<programlisting>
|
||||
wget -r -np -nH --cut-dirs=3 ftp://freebsd.sinica.edu.tw/pub/statue/test/
|
||||
測試.txt
|
||||
wget -r -np -nH -nd ftp://freebsd.sinica.edu.tw/pub/statue/test/
|
||||
%B4%FA%B8%D5.txt
|
||||
wget "ftp://freebsd.sinica.edu.tw/pub/statue/test/*"
|
||||
%B4%FA%B8%D5.txt</programlisting>
|
||||
<para><application>wget</application> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/wget</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
<para>由於不知名的原因,可能是為了避開特殊檔名,
|
||||
wget 會自動將抓取檔名的部分用 encode_string 處理過,
|
||||
所以該 patch 就把被 encode_string 處理成 "%3A" 這種東西,
|
||||
用 decode_string 還原成 ":",
|
||||
並套用在目錄與檔案名稱的部分,decode_string 是 wget 內建的函式。</para>
|
||||
<para>WWW: <ulink url="http://sunsite.auc.dk/wget/">
|
||||
http://sunsite.auc.dk/wget/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bdf-newchar">
|
||||
<title>如何造字?</title>
|
||||
<para>造字的問題,目前筆者會的只有造點陣字而已。</para>
|
||||
<para>首先,找到您要改的字型檔,在這邊假設是
|
||||
<filename>kc15f.bdf</filename>,我只會改 BDF 格式的,
|
||||
然後把點陣的格式嵌入該字型檔內。</para>
|
||||
<para>以 '文' 為例,先得到他的 ENCODING:</para
|
||||
<screen>
|
||||
&prompt.root; <userinput>echo "文" | hexdump</userinput>
|
||||
0000000 e5a4 000a
|
||||
0000003
|
||||
&prompt.root; <userinput>printf %d 0xa4e5</userinput>
|
||||
42213</screen>
|
||||
<para>以及他的 ucs-2:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>echo "文" | iconv -f big5 -t ucs-2 | hexdump</userinput>
|
||||
0000000 8765 0a00
|
||||
0000004</screen>
|
||||
<para>我們在這邊以 (方方土) 為例,他的 big5 code 是
|
||||
0x964f(38479),ucs-2 code 是 0x5803。</para>
|
||||
<para>先找到 <option>CHARS 13867</option>,因為我們要加新字,
|
||||
所以改成 <option>CHARS 13868</option>。</para>
|
||||
<para>然後到這個檔的最後,找最後一個 <option>STARTCHAR</option>
|
||||
加一,在這邊是 STARTCHAR 13868 為最後一個,所以也加一,
|
||||
然後將字塞最後,並在 <option>ENDFONT</option> 之前。</para>
|
||||
<programlisting>
|
||||
STARTCHAR 13869
|
||||
ENCODING 38479
|
||||
SWIDTH 31 0
|
||||
DWIDTH 16 0
|
||||
BBX 15 15 1 -3
|
||||
BITMAP
|
||||
1830
|
||||
1424
|
||||
FEFE
|
||||
2040
|
||||
3C78
|
||||
2488
|
||||
4488
|
||||
5528
|
||||
8A10
|
||||
0180
|
||||
0110
|
||||
3FF8
|
||||
0100
|
||||
0104
|
||||
FFFE
|
||||
ENDCHAR</programlisting>
|
||||
<para>然後跟著以下的方式作來讓 X 認識您所造的字:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/X11R6/lib/X11/fonts/encodings/large/</userinput>
|
||||
&prompt.root; <userinput>cp big5.eten-0.enc.gz big5.eten-0.enc.gz.bak</userinput>
|
||||
&prompt.root; <userinput>gunzip big5.eten-0.enc.gz</userinput>
|
||||
&prompt.root; <userinput>chmod 644 big5.eten-0.enc</userinput>
|
||||
&prompt.root; <userinput>vim big5.eten-0.enc</userinput>
|
||||
0x964F 0x5803
|
||||
&prompt.root; <userinput>chmod 444 big5.eten-0.enc</userinput>
|
||||
&prompt.root; <userinput>gzip big5.eten-0.enc</userinput>
|
||||
&prompt.root; <userinput>cd /usr/X11R6/lib/X11/fonts/local</userinput>
|
||||
&prompt.root; <userinput>fetch kc15f.bdf</userinput>
|
||||
&prompt.root; <userinput>mkfontdir</userinput>
|
||||
&prompt.root; <userinput>crxvt -fm -kc-fixed-medium-r-normal--16-160-72-72-c-160-big5-0</userinput>
|
||||
&prompt.root; <userinput>perl -e 'print pack("CC", 0x96, 0x4F);'</userinput></screen>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="ftpd">
|
||||
<title>內建 ftpd 的中文問題</title>
|
||||
<para>Contributed by: Wang.bbs@bbs.ba.mgt.ncu.edu.tw</para>
|
||||
<para>Last Update: 2003年 4月 1日 周二 12時57分00秒 CST</para>
|
||||
<para>Q: 4.7 Release 內建 ftpd,
|
||||
例如「程」、「逢」第二個 character 是 '{' 的中文字就下載不下來?</para>
|
||||
<para>A: 因為 FreeBSD 內建的 FTPD 會將 { 和 \ 的字去除,
|
||||
如果您想要讓這些中文字可可以正常使用請修改
|
||||
<filename>/usr/src/libexec/ftpd/ftpcmd.y</filename>
|
||||
找到下列這一行:</para>
|
||||
<programlisting>
|
||||
GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;</programlisting>
|
||||
<para>將它改成:</para>
|
||||
<programlisting>
|
||||
GLOB_NOCHECK|GLOB_TILDE|GLOB_NOESCAPE;</programlisting>
|
||||
<para>再重新 compile ftpd</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput> man 3 glob</userinput></screen>
|
||||
<programlisting>
|
||||
GLOB_NOESCAPE By default, a backslash (`\') character is used to
|
||||
escape the following character in the pattern, avoiding
|
||||
any special interpretation of the character. If
|
||||
GLOB_NOESCAPE is set, backslash escaping is disabled.
|
||||
|
||||
GLOB_BRACE Pre-process the pattern string to expand `{pat,pat,...}'
|
||||
strings like csh(1). The pattern `{}' is left unex-
|
||||
panded for historical reasons (and csh(1) does the same
|
||||
thing to ease typing of find(1) patterns).</programlisting>
|
||||
<para>我也弄成了 outta-port,有興趣可以直接到 outta-port/ftpd 底下安裝。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="chm2html">
|
||||
<title>.chm 怎麼在 Unix 底下觀看?</title>
|
||||
<para>Contributed by: mison@bbs.ee.ntu.edu.tw</para>
|
||||
<para>Last Update: 2003年 4月16日 周三 16時35分53秒 CST</para>
|
||||
<para>目前都是將 <filename>.chm</filename> 解壓縮成
|
||||
<filename>.html</filename> 後再,再用瀏覽器去看。
|
||||
現有的 .chm 方案有兩個,一個是
|
||||
<filename role="package">misc/chmlib</filename>
|
||||
以及 chmtools,不過兩套都沒有解壓縮的工具,
|
||||
或是不適合中文的處理,因此 mison 利用 chmtools 寫了一個
|
||||
chm2html 的工具,如果有興趣的人可以試試看。</para>
|
||||
<para><application>outta-port/chm2html</application> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/chm2html</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
<para>在這邊以一個 <filename>braille.chm</filename> 為例子,
|
||||
用 <command>chm2html</command>
|
||||
來解壓縮,並解壓縮到 braille 的目錄下:</para>
|
||||
<screen>chm2html < braille.chm braille/</screen>
|
||||
<para>在 braille 的目錄下會產生一個 braille.hhc 的目錄檔,
|
||||
接著再用 <command>hhc2html.pl</command> 將索引檔轉出來:</para>
|
||||
<screen>hhc2html.pl braille/braille.hhc > braille/braille.html</screen>
|
||||
<para>也可以用 <command>hhc2bookmark.pl</command> 將目錄檔轉成
|
||||
<application>mozilla</application> 的 bookmark 來用:</para>
|
||||
<screen>hhc2bookmark.pl --lo=on --root=`pwd`/brailee brailee/braille.hhc > bookmark.html</screen>
|
||||
<para>中文檔名的部分,只是把 chm 裡的 unicode 轉成 big5,
|
||||
這樣只是讓解出來的中文檔名可以讓人看得懂,hyper link還是會有問題。</para>
|
||||
<para>參數 <option>--lo=on</option> 是指定把大寫檔名改為小寫,
|
||||
這是因為 chm2thml 是根據 chm 檔頭解出檔案,
|
||||
而 hhc 目錄、chm 檔頭裡的檔名,兩者可能不一致。
|
||||
所以在第一步 chm 解開後、
|
||||
自行判斷要不要加 <option>--lo=on</option>。</para>
|
||||
<para>bookmark 只是一個暫時的解決方案,可以用
|
||||
<filename>hhc2bookmark.pl</filename> 轉出來的檔案替換原來
|
||||
<filename>~/.mozilla</filename> 裡的 bookmark,
|
||||
這樣可以模擬 MircoSoft IE 的 text/sitemap;其實有更好
|
||||
的方法, <application>mozilla</application> 有提供
|
||||
sidebar 和 IE sitemap 類似,或是在 <application>mozilla</application>
|
||||
讀取到特殊的副檔名或是 MIME Type 時去自動呼叫
|
||||
chm2html 並作成網頁來讀去。</para>
|
||||
<para>hyper link 檔名不一致的問題可能千奇百怪,轉目錄的程式是用 perl 寫的,
|
||||
若有需要,請自行修改 perl 程式裡的 regular expressions</para>
|
||||
<para>在將 hhc2html.pl 產生的目錄加到 sidebar 中,
|
||||
我測試的結果,使用如下的方式可以加入 sitebar:</para>
|
||||
<screen>javascript:window.sidebar.addPanel('title','http://','');</screen>
|
||||
<para>但是把 http:// 換成 file:// 就沒辦法加進去,所以還是直接執行
|
||||
<command>chm.sh braille.chm</command> 囉。</para>
|
||||
<para>在特殊檔名或是MIME Type的處理得感謝 bv1al 提供的靈感,
|
||||
使用 <application>mozilla</application> 也可以用類似方法開啟。</para>
|
||||
<programlisting>
|
||||
mozilla pull-down toolbar:
|
||||
Edit->Preferences->Navigator->HelperApplications->NewType:
|
||||
Description of type: MicroSoft HTML Help
|
||||
File extension: chm
|
||||
MIME Type: chemical/x-chemdraw application/mshelp
|
||||
Application to use: chm.sh</programlisting>
|
||||
<para>不過以上的方法在筆者測試下,並沒有作用,如果有人成功請告訴我一下。</para>
|
||||
<para>MicroSoft 有個程式可以 HTML 轉 CHM,也可以轉回來,應該是這個
|
||||
<ulink url="http://download.microsoft.com/download/OfficeXPProf/Install/4.
|
||||
71.1015.0/W98NT42KMe/EN-US/HTMLHELP.EXE">HTMLHELP.EXE</ulink>
|
||||
,在 MicroSoft 下處理 HTML 與 CHM 互轉時蠻好用的。</para>
|
||||
<para>WWW: <ulink url="http://66.93.236.84/~jedwin/projects/chmlib/">
|
||||
http://66.93.236.84/~jedwin/projects/chmlib/</ulink></para>
|
||||
<para>WWW: <ulink url="http://www.speakeasy.org/~russotto/chm/">
|
||||
http://www.speakeasy.org/~russotto/chm/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="konsole">
|
||||
<title>konsole 字距過大</title>
|
||||
<para>Settings -> Font -> Custom -> Terminal 12</para>
|
||||
<para>Settings -> Size -> 80x24 (VT100)</para>
|
||||
<figure>
|
||||
<title>konsole snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konsole" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cyrus-imapd2">
|
||||
<title>Cyrus-IMAP 將 8-bit 文字轉換為 X 的問題</title>
|
||||
<para>Contributed by 小郭 (jimkou.bbs@bbs.sayya.org)</para>
|
||||
<para>Last Update: Sat May 17 12:09:58 2003</para>
|
||||
<para>以 <filename role="package">mail/cyrus-imapd2</filename>-2.1.13
|
||||
架設郵件伺服器,有些信件的主旨全部變成了 XXXXXX ?
|
||||
這是 RFC 2047 的標準不相容 8Bit 主旨的郵件。
|
||||
目前能用的辦法是將標題編碼,這是比較標準的做法,
|
||||
或是修改 source code 兩個檔案
|
||||
<filename>imap/lmtpengine.c</filename> 以及
|
||||
<filename>imap/message.c</filename>
|
||||
讓收信的 IMAPD 支援 8Bit 主旨。</para>
|
||||
<programlisting>
|
||||
--- imap/lmtpengine.c.orig Sat May 17 14:45:39 2003
|
||||
+++ imap/lmtpengine.c Sat May 17 14:48:07 2003
|
||||
@@ -739,6 +739,7 @@
|
||||
state s = NAME_START;
|
||||
int r = 0;
|
||||
int reject8bit = config_getswitch("reject8bit", 0);
|
||||
+ int ignore8bit = config_getswitch("ignore8bit", 0);
|
||||
|
||||
if (namelen == 0) {
|
||||
namelen += NAMEINC;
|
||||
@@ -854,7 +855,7 @@
|
||||
form. */
|
||||
r = IMAP_MESSAGE_CONTAINS8BIT;
|
||||
goto ph_error;
|
||||
- } else {
|
||||
+ } else if (!ignore8bit) {
|
||||
/* We have been configured to munge all mail of this
|
||||
form. */
|
||||
c = 'X';</programlisting>
|
||||
<programlisting>
|
||||
--- imap/message.c.orig Fri Apr 18 06:49:49 2003
|
||||
+++ imap/message.c Sat May 17 14:46:27 2003
|
||||
@@ -229,6 +229,7 @@
|
||||
int n;
|
||||
int sawcr = 0, sawnl;
|
||||
int reject8bit = config_getswitch("reject8bit", 0);
|
||||
+ int ignore8bit = config_getswitch("ignore8bit", 0);
|
||||
int inheader = 1, blankline = 1;
|
||||
|
||||
while (size) {
|
||||
@@ -264,7 +265,7 @@
|
||||
/* We have been configured to reject all mail of this
|
||||
form. */
|
||||
if (!r) r = IMAP_MESSAGE_CONTAINS8BIT;
|
||||
- } else {
|
||||
+ } else if (!ignore8bit) {
|
||||
/* We have been configured to munge all mail of this
|
||||
form. */
|
||||
*p = 'X';</programlisting>
|
||||
<para>最後再編輯 <filename>${PREFIX}/etc/imapd.conf</filename>
|
||||
並增加一行:</para>
|
||||
<programlisting>ignore8bit = yes</programlisting>
|
||||
<para>RFC 2047 MIME (Multipurpose Internet Mail Extensions) Part Three:
|
||||
Message Header Extensions for Non-ASCII Text</para>
|
||||
<para>WWW: <ulink url="http://asg.web.cmu.edu/cyrus/">
|
||||
http://asg.web.cmu.edu/cyrus/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="font-width">
|
||||
<title>英文字和中文字等寬?</title>
|
||||
<para>Contributed by firefly</para>
|
||||
<para>TrueType 字體分成兩種,一種是可變字距,也就是每個字符寬度不一樣,
|
||||
比如 "x" 與 "i",這兩個字符就不等寬,它是在每個字符中紀錄該字符的寬度,
|
||||
大多數的 TrueType 都是這種格式。 </para>
|
||||
<para>另一種就是固定字距。也就是每個字符寬度都一樣,這樣顯示或打印時,
|
||||
會有對齊效果,比較美觀,在英語環境中,不會有任何問題,聰明的您,
|
||||
知道問題所在了吧。</para>
|
||||
<para>沒錯!CJK 的等寬字體,包含『半寬英數字符』與『全寬 CJK 字符』,
|
||||
字型引擎會把全寬字寬度套用在半寬字上頭,造成半寬字看起來間距太大,
|
||||
這就是問題所在。</para>
|
||||
<para>這裡提供一個方法,讓字型引擎忽略 CJK 字體指定的寬度,
|
||||
您可以將以下這段內容,複製到 ~/.fonts.conf 中:</para>
|
||||
<programlisting>
|
||||
<match target="font">
|
||||
<test target="pattern" name="lang" compare="contains">
|
||||
<string>zh-tw</string>
|
||||
<string>zh-cn</string>
|
||||
<string>ja</string>
|
||||
<string>ko</string>
|
||||
</test>
|
||||
<test name="spacing" compare="eq">
|
||||
<const>mono</const>
|
||||
</test>
|
||||
<edit name="globaladvance" mode="assign">
|
||||
<bool>false</bool>
|
||||
</edit>
|
||||
</match> </programlisting>
|
||||
<para>以上那段的意思是:當遇到 CJK 字型,又是等寬時,
|
||||
忽略系統內定寬度,這樣,當系統使用 CJK 等寬字時,
|
||||
便不會再有間距過大的問題。</para>
|
||||
<para>因為 MingLiU 宣稱自己是 monospaced 字型,但實際上它有兩種寬度:
|
||||
中文的全形以及英文的半形。</para>
|
||||
<programlisting>
|
||||
<match target="font">
|
||||
<test name="family"><string>MingLiU</string></test>
|
||||
<edit name="globaladvance"><bool>false</bool></edit>
|
||||
</match></programlisting>
|
||||
<para>還可以改 spacing,0 是 proportional 的 spacing,100 是 mono,
|
||||
110 是 charcell。</para>
|
||||
<programlisting>
|
||||
<match target="font">
|
||||
<test name="family"><string>MingLiU</string></test>
|
||||
<edit name="spacing"><int>0</int></edit>
|
||||
</match></programlisting>
|
||||
<para>在 X11 Core Font 的部分則是必須修改 XLFD,
|
||||
將 -m- 改成 -p-。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="pw">
|
||||
<title>pw 開帳號碰到'@'問題?</title>
|
||||
<para>Q: pw 在開帳號時,只要註解有 '@' 即有下面訊息:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pw useradd -n test -c "一" -d /home/test -g nogroup -m -s /bin/tcsh -w yes</userinput>
|
||||
pw: invalid character `@' at position 1 in gecos field</screen>
|
||||
<para>A: 徵求解答中。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="smbfs">
|
||||
<title>mount_smbfs 不能用中文 share 名稱?</title>
|
||||
<para>Q: mount_smbfs 使用中文 share 名稱遇到如下的錯誤:</para>
|
||||
<programlisting>mount_smbfs: unable to open connection: syserr = No such file or directory</programlisting>
|
||||
<para>A: 徵求解答中。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="flash">
|
||||
<title>flash 中文顯示?</title>
|
||||
<para>Q: Mozilla瀏覽flash網頁時中文字變成亂碼?</para>
|
||||
<para>A: 徵求解答中。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gtk-kde">
|
||||
<title>KDE 下使用 GTK 的字型問題?</title>
|
||||
<para>Q: 在 KDE 下運行 GTK 的軟體字型怪怪的?</para>
|
||||
<para>A: 執行 <command>gnome-settings-daemon &</command>,並用
|
||||
<command>gnome-control-center</command> 來設定字型。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="filename">
|
||||
<title>檔名大寫換小寫,含子目錄?</title>
|
||||
<para>Contributed by edwar</para>
|
||||
<para>big5 中文及特殊字元應該也都沒問題。</para>
|
||||
<programlisting>
|
||||
find ./t -depth \
|
||||
| perl -ne 'chomp;m</[^/]*$>;$d=$`;$_=$f=$&;'\
|
||||
's/([\x80-\xFF].)|(\w)/$1\l$2/g;system "echo",$d.$f,$d.$_ if $f ne $_'</programlisting>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,653 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.48
|
||||
-->
|
||||
|
||||
<chapter id="l10n">
|
||||
<title>FreeBSD 的中文化</title>
|
||||
<para>如果您還知道有那些 FreeBSD 中文化的計畫,請告訴我
|
||||
&a.statue;。
|
||||
</para>
|
||||
|
||||
<sect1 id="cfdp">
|
||||
<title>FreeBSD 中文文件計畫</title>
|
||||
<para>
|
||||
FreeBSD 中文文件計畫(FDP)目前正全力進行於 FreeBSD Handbook 文
|
||||
件的中文翻譯工作,它的網址是
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~ncvs/zh-translation/">
|
||||
http://freebsd.sinica.edu.tw/~ncvs/zh-translation/</ulink>。 </para>
|
||||
<para>
|
||||
目前在 CFDP 底下有三個文件,doc、zh-l10n-tut、zh-tut
|
||||
和一個 outta-port。 </para>
|
||||
<para>cvsup 取得方式:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>fetch ftp://freebsd.sinica.edu.tw/pub/ycheng/CVSUP/outta-port.supfile</userinput>
|
||||
&prompt.user; <userinput>fetch ftp://freebsd.sinica.edu.tw/pub/ycheng/CVSUP/zh-doc-all.supfile</userinput>
|
||||
&prompt.user; <userinput>fetch ftp://freebsd.sinica.edu.tw/pub/ycheng/CVSUP/zh-l10n-tut.supfile</userinput>
|
||||
&prompt.user; <userinput>fetch ftp://freebsd.sinica.edu.tw/pub/ycheng/CVSUP/zh-tut.supfile</userinput>
|
||||
&prompt.user; <userinput>cvsup -g zh-tut.supfile</userinput>
|
||||
</screen>
|
||||
<para>cvs 取得方式:分別為 doc/zh、zh-l10n-tut、zh-tut、outta-port</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>cvs -d :pserver:anoncvs@freebsd.sinica.edu.tw:/home1/ncvs login</userinput>
|
||||
(Logging in to anoncvs@freebsd.sinica.edu.tw)
|
||||
CVS password: <userinput>anoncvs</userinput>
|
||||
&prompt.user; <userinput>cvs -d :pserver:anoncvs@freebsd.sinica.edu.tw:/home1/ncvs checkout zh-tut</userinput> </screen>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="proj">
|
||||
<title>FreeBSD 中文化計劃</title>
|
||||
<para>
|
||||
下列地點可找到 FreeBSD 中文資訊。如果您還知道有其它未列出的,
|
||||
請告訴我 &a.statue;。 </para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~statue/boot/">FreeBSD 中文安裝介面</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/zh-fdp/">FreeBSD HandBook 翻譯</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~statue/zh-tut/outta.html">FreeBSD Outta-port</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://fatpipi.cirx.org/~vanilla/fcdp.html">FreeBSD FAQ 翻譯</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://zope.slat.org/Project/ZopeBook">ZopeBook</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://potian.163.net/">CGDP 中文GNU文檔工程</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.cmpp.net/">CMPP 中文MAN-PAGE計劃</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.china-pub.com/computers/eMook/emooknew/RFC/rfc.htm">RFC文檔中文翻譯計劃 </ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.pgsqldb.org/">PostgreSQL 中文信息</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://savannah.gnu.org/projects/chinese/">Savannah: Project Info - Chinese Translators Team</ulink>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="wwwsite">
|
||||
<title>FreeBSD 的中文站台</title>
|
||||
<para>
|
||||
下列地點可找到 FreeBSD 中文資訊。如果您還知道有其它未列出的,
|
||||
請告訴我 &a.statue;。
|
||||
</para>
|
||||
<para>推薦網站</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.study-area.org/">Study Area</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.gocar.idv.tw">傻瓜的FreeBSD教學網</ulink> (Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.lsps.tp.edu.tw/~gsyan/freebsd2001/">雄的家</ulink> (Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.lab.mlc.edu.tw/">苗栗縣大湖鄉大南國民小學 FreeBSD
|
||||
全球資訊網路架站日誌 </ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://turtle.ee.ncku.edu.tw/~tung/">優客筆記簿</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://ohaha.ks.edu.tw/">OHaHa's 學習心得</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.europa.idv.tw/">網路農夫</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://hk.geocities.com/L142857/ChComp/">中文電腦</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.freebsd.org.hk ">FreeBSD 資訊網</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.sinica.edu.tw/~cdp/">文獻處理實驗室</ulink> (Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.ascc.net/">中央研究院計算中心</ulink> (Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.iso10646hk.net/">香港 ISO 10646</ulink> (Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://140.136.81.146/%7Epg/book/paper.html">自由軟體桌面系統 -GNU/Linux</ulink> (Big5) BROKEN
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.cmex.org.tw/">中推會</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.cbflabs.com/">朱邦復工作室</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.liu.com.tw/">無蝦米中文輸入法</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://chewing.good-man.org/">酷音中文輸入法</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.geocities.com/Baja/Mesa/2118/">我的倉頡 - 中文輸入法推廣組織</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/">CFC 中文收藏家</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.ntu.edu.tw/taiwan/clement">Clem's XEmacs Page</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://main.rtfiber.com.tw/~changyj/">龍門少尉的窩</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://mouse.oit.edu.tw/">帆毅網路研究室</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.hello.com.tw/~wolfant/">黑手工人--築夢空間</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.math.ncu.edu.tw/~shann/Chinese/Welcome.html">中央大學 - 單維彰老師</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://mmlab.im.fju.edu.tw/~maa/">小馬的家</ulink>(Big5)
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.netwain.com/">NetWain 工作室</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://www.homed.idv.tw/freebsd/freebsd.htm">阿正的小窩</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://ccs.cc.nccu.edu.tw/marr/html/index.html">釋放 PC 的威力</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://php.lzp.ks.edu.tw/">PHP 架站日記</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
|
||||
<listitem><para>
|
||||
<ulink url="http://input.cpatch.org/">中文電腦技術及輸入法(檔案庫)</ulink>(Big5)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>FreeBSD 資源</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.ntu.edu.tw/bsd/">台灣大學 FreeBSD WWW Site</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://tw.freebsd.org/">交通資工 FreeBSD WWW Site</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://xcin.linux.org.tw/">XCIN Project 總部</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linux.org.tw/hardware/index.php3">台灣linux/freebsd硬體支援資料庫</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://turtle.ee.ncku.edu.tw/cgi-bin/boardlist.pl">FreeBSD/Unix/Java/Perl 的 Mailing List and News</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://rfc.im.tku.edu.tw">淡江資管RFC 文件檢索站</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://bsd.sinica.edu.tw/cgi-bin/cvsweb.cgi/">CVS-Web for FreeBSD Source Tree. </ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://phi.sinica.edu.tw/aspac/">ASPAC 文件</ulink>(Big5)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>其他發行版本</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.freebsd.org/">FreeBSD</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.openbsd.org/">OpenBSD</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.netbsd.org/">NetBSD</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.debian.org/intl/zh">Debian 中文計劃</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://mdk.linux.org.tw/">Linux Mandrake 中文之家</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://i18n.linux.org.tw/">I18N 程式中文化計劃</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://cle.linux.org.tw/">中文 GNU/Linux 延伸安裝套件</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://kde.linux.org.tw/">KDE 台灣</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linux-mandrake.com/zh/big5/">Mandrake Linux</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.cynix.com.tw/">Cynix OpenLinux</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linuxcenter.com.tw/">翔威國際 LinuxCenter</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.turbolinux.com.cn/">TurboLinux</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.bluepoint.com.cn/">Bluepoint Linux</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.cosix.com.cn/">COSIX Linux</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.redflag-linux.com/">Red-flag Linux</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linuxaid.com.cn/">Tom Linux</ulink>(GB)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>中文書籍</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010086875">FreeBSD應用軟體手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010019198">FreeBSD網路架站實務--附光碟</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010039387">FreeBSD抓得住INTERNET:伺服器架設與管理</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exec/item/0010093569">FreeBSD與Windows整合應用</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exec/item/0010047963">FreeBSD網路應用</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010013400">FreeBSD 3.X抓得住INTERNET進階伺服器的架設與管理</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exec/item/0010032002">FreeBSD與Windows整合應用(第二版)</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010086873">FreeBSD安裝設定與使用</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010007211">使用FreeBSD及Apache-活用PHP與MySQL建構Web世界</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010187476">輕鬆使用LINUX/FREEBSD建置自已的網路王國</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.books.com.tw/exep/prod/booksfile.php?item=0010148811">FreeBSD系統建構指引</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.tenlong.com.tw/BookSearch/Search.php?isbn=9867944925">FreeBSD 完全探索 (Absolute BSD: The Ultimate Guide to FreeBSD)
|
||||
</ulink>(Big5)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>組織網站</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/">FreeBSD 之家</ulink>(Big5)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>新聞網站</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.bsdtoday.com/">BSD Today</ulink>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freshports.org/">FreeBSD ports 專門介紹軟體及版本更新通知的網站</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.daemonnews.org/">Daily Daemon News</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.posi.net/freebsd/drivers/">BSD 驅動程式資料庫</ulink>(Eng)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.bsdapps.org/">BSD 應用程式資料庫</ulink>(Eng)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>文件資源</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.csie.nctu.edu.tw/document/unixfaq/">UNIX 常見問答集</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~ncvs/zh-big5-FAQ/FAQ.html">FreeBSD 2.X 常見問答集</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.ntu.edu.tw/~phantom/cfreebsd/">FreeBSD 使用者手冊(FAQ)</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://tw.freebsd.org/handbook.big5/handbook.html">FreeBSD 2.1.0 使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~ncvs/zh-handbook/handbook.html">FreeBSD 2.2.8 使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~ncvs/zh-big5-handbook/index.html">FreeBSD 3.3 使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~ncvs/zh-l10n-tut/">FreeBSD 中文使用文件計畫</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://freebsd.ntu.edu.tw/">台大 FreeBSD 中文 FAQ Web (woju)</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="gopher://freebsd.csie.nctu.edu.tw/">交大資工 FreeBSD 版精華區 gopher (jdli)</ulink>(Big5) BROKEN
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/docs/mysqldoc_big5/manual_toc.html">MySQL 3.23.pre7 中文使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/docs/pos~tgresql_big5/postgres.htm">PostgreSQL 6.5 中文使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/docs/pgsqldoc-7.0c/postgres.htm">PostgreSQL 7.0 中文使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://php.wilson.gs/bible/">PHP 聖經</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://mouse.oit.edu.tw/NetBSD/">NetBSD 1.41版安裝手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://digital.oit.edu.tw/openbsd/">OpenBSD 簡介與安裝</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://residence.educities.edu.tw/yjchen/freebsd/">Servlet + JSP + mysql jdbc + chinese</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/perlfaq/perlfaq/">Perl 常見問題與解答</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://mdk.linux.org.tw/lyx-doc/lyx-1.html">中文 LyX 使用簡介</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linpus.com.tw/manual/gnome1.0/content.htm">GNOME 1.0 使用者手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.linpus.com.tw/manual/kdeug/userguide/">KDE 使用者手冊 pre1.0 12/24/1998</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://tech.sina.com.cn/focus/FreeBSD/index.shtml">FreeBSD使用大全</ulink>(GB)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://www.enctc.edu.tw/other/freebsd.htm">FreeBSD管理介面使用手冊</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://coder.9ug.com/language/script/python.html">Python 教學文件</ulink>(Big5)
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>經典文章</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/FSF.html">自由軟體基金會 (Free Software Foundation)</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/Howto-Become-a-Hacker.html">如何成為一位 Hacker</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/Brief-of-History-Hackerdom.html">Hacker 文化簡史</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/homesteeding/">開拓智域</ulink>(Big5)
|
||||
</para></listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/cathedral-bazaar/cathedral-bazaar.html">教堂觀與市集觀</ulink>(Big5)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/osr.html">開放原始碼革命</ulink>(Big5)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/open-source.html">Open Source 簡介</ulink>(Big5)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><ulink url="http://netlab.cse.yzu.edu.tw/~statue/cfc/goods/other/open-source-def.html">Open Source 的定義</ulink>(Big5)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>下載站台</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<ulink url="ftp://freebsd.csie.nctu.edu.tw/pub/01TW_Service.TXT">台灣公開列表</ulink>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="newgroup">
|
||||
<title>FreeBSD 的中文討論區</title>
|
||||
<para>
|
||||
如果您有問題,可以在這些討論區發問,用中文也通哦!不過請確定您
|
||||
已經先看過了相關的文件或 HOWTO。否則重複問一些 FAQ 是很不
|
||||
受歡迎的!
|
||||
</para>
|
||||
<para>
|
||||
<ulink url="news://tw.bbs.comp.386bsd">news://tw.bbs.comp.386bsd</ulink></para>
|
||||
<para>Openfind BBS 網路論壇,tw.bbs.comp.386bsd 看板。</para>
|
||||
<para>
|
||||
<ulink url="http://bbs.openfind.com.tw/cgi-bin/x_list?BOARD=tw.bbs.comp.386bsd">
|
||||
http://bbs.openfind.com.tw/cgi-bin/x_list?BOARD=tw.bbs.comp.386bsd</ulink></para>
|
||||
<para>中研院所架設的台灣 FreeBSD 通信論壇。</para>
|
||||
<para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/mailman/listinfo">
|
||||
http://freebsd.sinica.edu.tw/mailman/listinfo</ulink></para>
|
||||
<para>中研院舊版本通信論壇,舊信倉庫。</para>
|
||||
<para>
|
||||
<ulink url="http://freebsd.sinica.edu.tw/~majordom/">
|
||||
http://freebsd.sinica.edu.tw/~majordom/</ulink></para>
|
||||
<para>香港 bsd talk 通信論壇:</para>
|
||||
<para>
|
||||
<ulink url="news://news.linux.org.hk/hklug.bsd.talk">
|
||||
news://news.linux.org.hk/hklug.bsd.talk</ulink></para>
|
||||
<para>
|
||||
<ulink url="http://www.shellhung.org/mailman/listinfo/">
|
||||
http://www.shellhung.org/mailman/listinfo/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="irctw">
|
||||
<title>FreeBSD 的中文 IRC 聊天室</title>
|
||||
<para>
|
||||
這是目前 BSD 使用者在網路上聚會聊天的地方,通常都會有一群人在此發呆
|
||||
、哈拉、打屁。
|
||||
</para>
|
||||
<para>
|
||||
在 FreeBSD 底下通常都是使用 <filename>ports/chinese</filename>
|
||||
底下的 <application>bitchx</application> 或是
|
||||
<filename>ports/irc</filename> 底下的
|
||||
<application>xchat</application> 當作
|
||||
IRC 用戶端,在 Windows 底下則是以
|
||||
<ulink url="http://www.mirc.com/">mIRC</ulink> 為主。
|
||||
</para>
|
||||
<para>
|
||||
<application>bitchx</application> 或
|
||||
<application>xchat</application> 的使用方式:
|
||||
</para>
|
||||
<procedure>
|
||||
<step><para>啟動 irc client</para></step>
|
||||
<step><para>出現 prompt 後</para></step>
|
||||
<step><para>/server irc.taiwan.com</para></step>
|
||||
<step><para>/join #bsdchat</para></step>
|
||||
</procedure>
|
||||
<para>mIRC 的使用方式:</para>
|
||||
<procedure>
|
||||
<step><para>File -> Options -> Connect -> Add</para></step>
|
||||
<step><para>IRC Server: irc.taiwan.com</para></step>
|
||||
<step><para>Connect to IRC Server</para></step>
|
||||
<step><para>/join #bsdchat</para></step>
|
||||
</procedure>
|
||||
<para>
|
||||
近來因為主機與網路的關係,IRC Server 先換到 irc.seed.net.tw。
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
mIRC 小秘訣:如何用微軟新注音輸入法改字呢?
|
||||
在要改的那個字上面按空白鍵,然後選擇所要的字,決定後再按空白鍵。
|
||||
</para>
|
||||
<para>
|
||||
mIRC 中文化:您需要先安裝mIRC32 v.5.91在您的電腦內,
|
||||
然後才可執行這個patch檔來進行中文化的工作。使用方法:先去
|
||||
www.mirc.com捉取mIRC591t.exe這個檔回來安裝(記住,這一版patch
|
||||
是給mIRC32 v5.91使用的!不要拿其他版來patch!)然後把
|
||||
p010901.exe 拷貝到您mIRC安裝的目錄下,執行p010901.exe。
|
||||
執行完畢後,就會自動產生一個中文化過的mIRC執行檔,CmIRC591.exe。
|
||||
您可以直接在mIRC的目錄下執行這個檔。</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="organisations">
|
||||
<title>Organisations Working in Open Source</title>
|
||||
<para>Government</para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.oss.org.tw/">OpenSource Software Portal(OSSP)</ulink>,IDB MoEA </para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Research Institute </para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://twgrid.org/">Taiwan Grid Computing Project</ulink>,Computing Center Academia Sinica </para></listitem>
|
||||
<listitem><para><ulink url="http://opensource.nchc.org.tw/">National Center for High-performance Computing (NCHC)</ulink> </para></listitem>
|
||||
<listitem><para><ulink url="http://www.openfoundry.org/">Open Source Software Foundry (OSSF)</ulink>,IIS Academia Sinica </para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Association</para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.slat.org/">Software Liberty Association of Taiwan (SLAT) </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://linux.tca.org.tw/">Linux Compatibility Test and Certification Center (LCTaCC)</ulink>, TCA</para></listitem>
|
||||
<listitem><para><ulink url="http://ossc.cosa.org.tw/">Open Source Software Center(OSSC)</ulink>, COSA</para></listitem>
|
||||
<listitem><para><ulink url="http://twopensource.org/">ICOS</ulink> - Internation Conference on Open Source.</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Education </para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://sfs.wpes.tcc.edu.tw/">School Administration System Devloper Portal </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://free.tnc.edu.tw/">OSS Portal for Teacher in Tainan </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://sfs.ilc.edu.tw/">OSS Portal for Teacher in Yi-Lan </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://163.23.89.67/">OSS Portal for Teacher in Chang-Hua </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.bamboo.hc.edu.tw/linux/">Community College Linux Course in Shin-Chu</ulink>, Bamboo Community College</para></listitem>
|
||||
<listitem><para><ulink url="http://edu.slat.org/">Open Source Software application consulting center (OSSACC)</ulink>, SLAT</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Training </para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://edu.uuu.com.tw/class/series.asp?seat=Linux">UCOM</ulink> - RedHat Certified training. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.fitpi.com.tw/">Finesse IT</ulink> - Linux SA & embedded Linux training. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.ginnet.com.tw/class/linux.htm">GIN</ulink> - Linux use & manage training. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.iiiedu.org.tw/index.aspx">IIIEDU</ulink> - Connected Linux training. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.shinewave.com.tw/chinese/training/Main_edu.htm">Shinewave</ulink> - LPI Certified Training.</para></listitem>
|
||||
<listitem><para><ulink url="http://www.oss.com.tw/">OSS School</ulink> - ThizLinux & OSS training.</para></listitem>
|
||||
<listitem><para><ulink url="http://www.pcschool.com.tw/">Great Master</ulink> - LPI Certified & WebMaster training.</para></listitem>
|
||||
<listitem><para><ulink url="http://www.lccnet.com.tw/">1ccnet</ulink> - OpenLinux & LPI Certified training.</para></listitem>
|
||||
<listitem><para><ulink url="http://www.pviva.com/">PEI YA</ulink> - Linux teaching CD.</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>Business </para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.ossti.com/">OSSTI</ulink> - Software technology and service base on GCC compiler. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.citron.com.tw/">Citron Network</ulink> - VoIP base on <ulink url="http://www.gnugk.org/">Gatekeeper</ulink>. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.linpus.com.tw/">Linpus</ulink> - Embedded system & Embedded GUI base on Linux,Linpus Linux OS. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.eshida.com/">Eshida.com</ulink> - Embedded system development tools base on Linux. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.wiscore.com.tw/">Wiscore</ulink> - Embedded,Information Appliances base on Linux. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.erexi.com.tw/">Erexi</ulink> - HA,LDAP,Mail,Cluster solutions base on Turbolinux. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.toppoint.com.tw/">toppoint</ulink> - small SI with OSS solutions. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.brain-c.com/">brain-c</ulink> - small SI with OSS solutions. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.synology.com/">Synology</ulink> - NAS base on FreeBSD. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.dbmaker.com.tw/">SYSCOM</ulink> - Database support with FreeBSD. </para></listitem>
|
||||
<listitem><para><ulink url="http://www.pgsql.com.tw/">datsoft</ulink> - ERP base on PostgreSQL. </para></listitem>
|
||||
</itemizedlist>
|
||||
<para>FS/OSS User Group</para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.bug.club.tw/">FreeBSD User Club</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.debian.org.tw/">Debian Linux User Group</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.gentoo.org.tw/">Gentoo Linux User Group</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.slackware.org.tw/">Slackware Linux User Group</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://tnlug.linux.org.tw/">Tainan Linux User Group</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://kalug.linux.org.tw/">Kaohsiung Linux User Group</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://turtle.ee.ncku.edu.tw/openwebmail/">OpenWebMail</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.zope.org.tw/">Zope</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.postgresql.idv.tw/">PostgreSQL</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://phpbb-tw.net/phpbb/">phpBB</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.phpnuke-tw.com/">PHP-Nuke</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://tw.xoops.org/">XOOPS</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://phpbb.elixus.org/">Blog</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://wiki.newzilla.org/WiKi">Wiki</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://kde.linux.org.tw/">KDE</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://ooo.tnc.edu.tw/">OpenOffice</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.csie.ntu.edu.tw/~b7506051/mozilla/">Mozilla</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.python.org.tw/">Python</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.doochun.org/">DooChun</ulink> - Embedded Linux base on x86</para></listitem>
|
||||
<listitem><para><ulink url="http://savannah.gnu.org/projects/chinese/">GNUCTT</ulink> - GNU Chinese Translators Team. </para></listitem>
|
||||
<listitem><para><ulink url="http://cle.linux.org.tw/">CLE</ulink> - Chinese Linnux Extension. </para></listitem>
|
||||
<listitem><para><ulink url="http://xcin.linux.org.tw/">XCIN</ulink> - An XIM (X Input Method) server. </para></listitem>
|
||||
<listitem><para><ulink url="http://sourceforge.net/projects/big5con">big5con</ulink> - A Chinese input in console mode. </para></listitem>
|
||||
<listitem><para><ulink url="http://chewing.good-man.org/">Chewing</ulink> - A Chinese input base on XCIN. </para></listitem>
|
||||
<listitem><para><ulink url="http://i18n.linux.org.tw/">I18N Linux</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://wiki.debian.org.tw/index.php?page=3Anoppix">3Anoppix</ulink> - Chinese localization of KNOPPIX. </para></listitem>
|
||||
</itemizedlist>
|
||||
<para>OSS Portals / Websites </para>
|
||||
<itemizedlist>
|
||||
<listitem><para><ulink url="http://www.linuxfab.com/">LinuxFab</ulink> - Open Source Community Portal</para></listitem>
|
||||
<listitem><para><ulink url="http://www.linux.org.tw/">Linux Portal</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://phorum.study-area.org/">Study-Area</ulink> - OSS & Computer forum </para></listitem>
|
||||
<listitem><para><ulink url="http://www.freenix-server.info/">Freenix</ulink> - Freenix Server Document Project </para></listitem>
|
||||
<listitem><para><ulink url="http://anti_ms.tripod.com/">Anti-MS News</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.linuxuser.com.tw/">Linux User News</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.linuxnews.idv.tw/">Linux News</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.cyut.edu.tw/~ckhung/a/">Chao-Kuei Hung's Home Page </ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.europa.idv.tw/index.php">Internet farmer</ulink></para></listitem>
|
||||
<listitem><para><ulink url="http://www.toppoint.com.tw/charles">Charles' phpBB</ulink></para></listitem>
|
||||
</itemizedlist>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,260 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.27
|
||||
-->
|
||||
|
||||
<chapter id="mailclient">
|
||||
<title>中文郵件用戶端</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="sylpheed">
|
||||
<title>sylpheed - 建構在 GTK+ 上,輕量級且快速的電子郵件軟體</title>
|
||||
<para>
|
||||
GPL base client,base on <application>GTK+</application>。
|
||||
它是日本人寫的,已經支援 I18N 和 XIM。
|
||||
在顯示和輸入中文都沒問題,和
|
||||
<application>xcin2.5</application> 也搭配良好。 </para>
|
||||
<para>安裝 <filename role="package">mail/sylpheed</filename>。</para>
|
||||
<para>
|
||||
安裝完後,必須修改字型設定,修改
|
||||
<filename>$HOME/.sylpheed/sylpheedrc</filename> 檔,
|
||||
將 message_font 改成下面的樣子。 </para>
|
||||
<programlisting>
|
||||
message_font=8x16,kc15f,-*-16-*-big5-0</programlisting>
|
||||
<figure>
|
||||
<title>sylpheed snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/sylpheed" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://sylpheed.good-day.net/">
|
||||
http://sylpheed.good-day.net/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mutt">
|
||||
<title>mutt - 功能強大的電子郵件軟體</title>
|
||||
<para>
|
||||
console 模式下的中文電子郵件軟體。
|
||||
<application>Mutt</application>
|
||||
-- "The Mongrel of Mail User Agents" 包含了很多其他
|
||||
如 <application>Elm</application>、
|
||||
<application>Pine</application>、
|
||||
<application>mh</application>、
|
||||
<application>slrn</application> 的特點,特性是包含顏色支援,
|
||||
訊息串流
|
||||
,MIME 解碼 (包含 RFC1522 支援得標頭編碼),個人化金鑰的保存
|
||||
,POP3,支援 DSN 和 PGP/MIME。 </para>
|
||||
<para>安裝 <filename role="package">chinese/mutt</filename>。</para>
|
||||
<para>設定 <filename>.muttrc</filename></para>
|
||||
<programlisting>
|
||||
set charset=big5
|
||||
set locale="zh_TW.Big5"
|
||||
set send_charset="big5:gb2312:us-ascii:iso-8859-1:utf-8:x-unknown"
|
||||
charset-hook us-ascii big5
|
||||
charset-hook iso-8859-1 big5 </programlisting>
|
||||
<para>如果寄信給 bbs 的朋友,有亂碼問題的話</para>
|
||||
<programlisting>
|
||||
echo "set bbsislame=yes" >> ~/.muttrc </programlisting>
|
||||
<para>mutt 1.3.x 讀 utf8 及簡體中文的信件都沒有問題。</para>
|
||||
<figure>
|
||||
<title>mutt snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/mutt" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.mutt.org/">
|
||||
http://www.mutt.org/</ulink> </para>
|
||||
<para>
|
||||
Mutt 使用者資訊:<ulink url="http://www.math.fu-berlin.de/~guckes/mutt/">
|
||||
http://www.math.fu-berlin.de/~guckes/mutt/</ulink>。
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="pine4">
|
||||
<title>pine4 - 操作便利的電子郵件軟體</title>
|
||||
<para>
|
||||
console 模式下的中文電子郵件軟體。
|
||||
大部份的訊息、選單都已經中文化了也可以正確無誤的處理中文信件,
|
||||
是個很方便的讀信軟體。
|
||||
<application>pine4</application> 的功能包含了支援 MINE
|
||||
、通訊錄,還支援 IMAP、mail 與 MH 格式的資料。 </para>
|
||||
<para>安裝 <filename role="package">chinese/pine4</filename>。</para>
|
||||
<para>
|
||||
若是顯示仍有問題的話,進入 <application>pine4</application>
|
||||
之後選 <option>SETUP/Config</option>
|
||||
在 <option>feature list</option> 中勾選(按 X):
|
||||
</para>
|
||||
<programlisting>
|
||||
[X] enable-8bit-esmtp-negotiation
|
||||
[X] enable-8bit-nntp-posting </programlisting>
|
||||
<para>
|
||||
然後在 <option>character-set</option> 上按
|
||||
<command>C</command>,將其值
|
||||
改為 big5 或 gb2312。按 <command>E</command> 脫離儲存即可。 </para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.washington.edu/pine/">
|
||||
http://www.washington.edu/pine/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mail-code">
|
||||
<title>郵件亂碼?</title>
|
||||
<para>由於歷史原因,Internet 上有些郵件系統只支援 7Bit 的字元傳輸,
|
||||
而漢字的內碼是 8Bit 的,當在電子郵件中發送中文時,
|
||||
如果經過這些只支援 7Bit 字元的郵件系統,
|
||||
便會將漢字內碼的第八位元的 1 全部變成 0。</para>
|
||||
<para>以 "中文" 兩字為例,HEX 為 A4A4A4E5,
|
||||
當最高位元被清掉時就會變成 24242465,也就是 "$$$e"。
|
||||
<application>telnet</application> 也存在這樣子的問題。</para>
|
||||
<para>除了中文郵件外,使用電子郵件傳送圖片、程式、
|
||||
壓縮文件等也會發生這個問題。
|
||||
所以在電子郵件中一般採用各種郵件編碼方式來解決這個問題,
|
||||
將 8Bit 按照一定的規則進行編碼,
|
||||
便可以完好地通過只支持 7Bit 字元的郵件系統。</para>
|
||||
<para>常見的郵件編碼有 UU 與 MIME,而 MIME
|
||||
(Multipurpose Internet Mail Extentions)
|
||||
一般翻譯成「多媒體傳送模式」,
|
||||
顧名思義,它標榜的就是可以傳送多媒體型式的檔案,
|
||||
可以在一封mail中附加各種型式檔案一起送出。</para>
|
||||
<para>MIME 定義兩種編碼方法:Base64 與QP(Quote-Printable),
|
||||
兩者使用時機不同,QP 的規則是對於資料中的7bits無須重複encode,
|
||||
僅8bits資料轉成7bits。QP編碼適用於非US-ASCII的文字內容,
|
||||
例如我們的中文檔案,而Base64的編碼規則,是將整個檔案重新編碼,
|
||||
編成7bits,它是用於傳送binary檔案時使用。
|
||||
由於編碼的方式不同,會影響編碼之後的檔案大小。
|
||||
有些較懶惰的軟體便都一律採用Base64編碼了。</para>
|
||||
<para>含有 MIME 編碼的文件,您查看它的源始碼,一般都含有:
|
||||
"This is a multi-part message in MIME format." 這樣的句子。</para>
|
||||
<para>以下我們以 <application>mmencode</application>
|
||||
(又稱為 <application>mimencode</application>) 作為 QP 與 BASE64 的範例,
|
||||
安裝 <filename role="package">converters/mmencode</filename>。</para>
|
||||
<para>RFC 2045 - Multipurpose Internet Mail Extensions (MIME)
|
||||
Part One: Format of Internet Message Bodies </para>
|
||||
<para>RFC 2046 - Multipurpose Internet Mail Extensions (MIME)
|
||||
Part Two: Media Types</para>
|
||||
<para>RFC 2047 - MIME (Multipurpose Internet Mail Extensions)
|
||||
Part Three: Message Header Extensions for Non-ASCII Text
|
||||
<sect2 id="uu">
|
||||
<title>UU 編碼 (uuencode與uudecode)</title>
|
||||
<para>
|
||||
UU 是指 Unix 之間傳送二進制文件,就是 Unix to Unix。
|
||||
使用 uuencode 將檔案編成7位元ASCII檔案,把它寄出,
|
||||
收信人收到後,可以用 uudecode 將這份資料還原為原來的檔案。</para>
|
||||
<para>
|
||||
uuencode 的第一個參數是要加碼的檔案,也就是您信件的內容。
|
||||
第二個參數是希望收信人解開後檔案叫什麼名字。</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>echo "中文" > infile</userinput>
|
||||
&prompt.user; <userinput>uuencode infile remotefile</userinput>
|
||||
begin 644 remotefile
|
||||
%I*2DY0KQ
|
||||
`
|
||||
end
|
||||
&prompt.user; <userinput>uuencode infile remotefile | mail statue</userinput>
|
||||
&prompt.user; <userinput>mail</userinput>
|
||||
Mail version 8.1 6/6/93. Type ? for help.
|
||||
"/var/mail/statue": 1 message 1 new
|
||||
>N 1 statue Fri Dec 21 13:12 16/390
|
||||
&
|
||||
Message 1:
|
||||
From statue Fri Dec 21 13:12:19 2001
|
||||
Date: Fri, 21 Dec 2001 13:12:19 +0800 (CST)
|
||||
From: statue <statuei>
|
||||
To: statue
|
||||
|
||||
begin 644 remotefile
|
||||
%I*2DY0KQ
|
||||
`
|
||||
end
|
||||
& <userinput>s mail1</userinput>
|
||||
"mail1" [New file]
|
||||
& <userinput>q</userinput>
|
||||
&prompt.user; <userinput>uudecode mail1</userinput>
|
||||
&prompt.user; <userinput>cat remotefile</userinput>
|
||||
中文</screen>
|
||||
<sect2 id="qp">
|
||||
<title>QP - Quote-Printable</title>
|
||||
<para>
|
||||
Content-Transfer-Encoding: quoted-printable</para>
|
||||
<para>
|
||||
QP編碼的方式,是將一個字元用二個16進位法的數值表示,
|
||||
然後前面再加個「=」字元(等號):</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>echo "中文" | mmencode -q</userinput>
|
||||
=A4=A4=A4=E5
|
||||
&prompt.user; <userinput>echo "=A4=A4=A4=E5" | mmencode -q -u</userinput>
|
||||
中文</screen>
|
||||
<para>或是用 perl 來將 QP 解碼:</para>
|
||||
<programlisting>
|
||||
while(defined($line = <STDIN>)) {
|
||||
$line =~ s/=([0-9A-Fa-f][0-9A-Fa-f])/chr hex $1/ge;
|
||||
$line =~ s/[\n\r]+$//;
|
||||
print STDOUT $line;
|
||||
}</programlisting>
|
||||
<para>用 perl 來將文字編成 QP 碼:</para>
|
||||
<programlisting>
|
||||
while(defined($line = <STDIN>)) {
|
||||
$line =~ s/([=\x00-\x1F\x80-\xFF])/sprintf("=%02X",ord($1))/ge;
|
||||
print STDOUT $line;
|
||||
}</programlisting>
|
||||
</sect2>
|
||||
<sect2 id="base64">
|
||||
<title>BASE64</title>
|
||||
<para>
|
||||
Content-Transfer-Encoding: BASE64</para>
|
||||
<para>
|
||||
BASE64 的算法很簡單,它將字符流順序放入一個 24 位的緩衝區,
|
||||
缺字符的地方補零。然後將緩衝區截斷成 4 個部分,高位在先,
|
||||
每個部分 6 位,用下面的64個字符重新表示:
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"。
|
||||
如果輸入只有一個或兩個字節,那麼輸出將用等號 "=" 補足。
|
||||
還可以隔斷附加的信息造成編碼的混亂。這就是BASE64。</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>echo "中文" | mmencode</userinput>
|
||||
pKSk5Qo=
|
||||
&prompt.user; <userinput>echo "pKSk5Qo=" | mmencode -u</userinput>
|
||||
中文</screen>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>其他亂碼?</title>
|
||||
<para>以 "中文" 兩字為例,整理一下以上的編碼會出現的狀況:</para>
|
||||
<programlisting>
|
||||
uuencode:%I*2DY0KQ
|
||||
QP:=A4=A4=A4=E5
|
||||
BASE64:pKSk5Qo=</programlisting>
|
||||
<para>以及其他語言性的轉碼可能出現的狀況:</para>
|
||||
<programlisting>
|
||||
GB2312:笢恅(iconv -t GB2312)
|
||||
Unicode:U+4E2D U+6587
|
||||
UCS-2:N-e(iconv -t UCS-2)
|
||||
UTF-7:+Ti1lhw(iconv -t UTF-7)
|
||||
UTF-8:銝剜??(iconv -t UTF-8)
|
||||
UTF-16:??N-e?(iconv -t UTF16)
|
||||
UTF-32:??N-e?(iconv -t UTF32)
|
||||
CNS11643:1-4463 1-4546
|
||||
CCCII:213034 214258</programlisting>
|
||||
<para>另外一些有的沒的程式會出現的狀況:</para>
|
||||
<programlisting>
|
||||
hexdump:0000000 a4a4 e5a4 000a
|
||||
0000005(hexdump)</programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,319 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.12
|
||||
-->
|
||||
|
||||
<chapter id="message">
|
||||
<title>中文的訊息</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="help-localize">
|
||||
<title>幫助本地化和翻譯的工作</title>
|
||||
<para>目前 FreeBSD 的主要文件如下:FreeBSD Handbook,FAQ,
|
||||
ports-handbook,developers-handbook,articles,manual,www。</para>
|
||||
<para>但是有翻譯的部份不多,僅有 handbook,FAQ,ports-handbook。</para>
|
||||
<sect2 id="handboook">
|
||||
<title>FreeBSD handbook</title>
|
||||
<para>本來是由 FreeBSD 中文文件計畫所主持(FDP),
|
||||
歷經 ijliao@FreeBSD.ORG,foxfair@FreeBSD.ORG &
|
||||
vanilla@FreeBSD.ORG,目前由筆者代為維護中。</para> <para>WWW: <ulink url="http://www.csie.nctu.edu.tw/~ijliao/handbook.html">
|
||||
ijliao 的 Handbook 翻譯分配表</ulink></para> <para>WWW: <ulink url="http://people.freebsd.org/~foxfair/zh-fdp.html">
|
||||
foxfair 的 Handbook 翻譯分配表</ulink></para>
|
||||
<para>WWW: <ulink url="http://freebsd.sinica.edu.tw/~statue/zh-fdp/">
|
||||
statue 的 Handbook 翻譯分配表</ulink></para>
|
||||
<para>WWW: <ulink url="http://freebsd.sinica.edu.tw/handbook/index.html">
|
||||
繁體 FreeBSD Handbook 4.3</ulink></para>
|
||||
<para>而大陸已經有翻譯完成的簡體 Handbook 的書籍正在販售中,
|
||||
也有其簡體的 PDF 檔案可以提供下載,希望大家可以參考該書,
|
||||
把我們的繁體 Handbook 也翻譯完成。</para>
|
||||
<para>WWW: <ulink url="http://freebsd.sinica.edu.tw/gb2312.php">
|
||||
簡體 FreeBSD Handbook 4.7</ulink></para>
|
||||
</sect2>
|
||||
<sect2 id="freebsd-faq">
|
||||
<title>FreeBSD FAQ</title>
|
||||
<para>曾經由 vanilla@FreeBSD.ORG 帶領翻譯完成整個 FAQ,
|
||||
不過後來沒有與總部繼續更新,不過最近他又回來了,
|
||||
繼續領導著 FAQ 的翻譯。</para>
|
||||
<para>WWW: <ulink url="http://fatpipi.cirx.org/~vanilla/fcdp.html">
|
||||
vanilla 的 FAQ 翻譯分配表</ulink></para>
|
||||
</sect2>
|
||||
<sect2 id="porters-handbook">
|
||||
<title>FreeBSD Porters Handbook</title>
|
||||
<para>這對想做自己 port 的人是一份很好的文件,不過目前尚未翻譯,
|
||||
但是有簡體的使用者翻譯好了,不過還需要修飾和整理成繁體的。</para>
|
||||
<para>WWW: <ulink url="http://freebsd.sinica.edu.tw/~statue/docs/ports-handbook-gb2312/">
|
||||
簡體 FreeBSD Porters Handbook</ulink></para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="join-l10n">
|
||||
<title>參加中文 I18N/L10N 的計畫</title>
|
||||
<para>PO 翻譯:GNOME,KDE</para>
|
||||
<para>目前國內幫忙翻譯訊息的組織集中在 KDE3,如果有興趣可以前往
|
||||
<ulink url="http://i18n.linux.org.tw/">
|
||||
http://i18n.linux.org.tw/</ulink> 瀏覽目前的翻譯狀況。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="po">
|
||||
<title>翻譯 PO 檔注意事項</title>
|
||||
<para>以下摘錄 kde3 翻譯小組的一些建議,原始文件可以在
|
||||
<ulink url="http://www.linux.org.tw/~ycheng/kde/trans-po.txt">
|
||||
http://www.linux.org.tw/~ycheng/kde/trans-po.txt</ulink> 找到。</para>
|
||||
<para>Contributed by pofeng@linux.org.tw</para>
|
||||
<para>Last Update 2003年 5月10日 周六 11時26分18秒 CST</para>
|
||||
<para>標頭部份:</para>
|
||||
<para>每個 po 檔一開頭的幾行,大多固定長的像底下的樣子,
|
||||
其中比較要注意的幾個項目為:</para>
|
||||
<programlisting>
|
||||
==== 標頭範例 ===============================================================
|
||||
# traditional Chinese translation for XXX.
|
||||
# Pofeng Lee <pofeng@linux.org.tw>, 2001-2002.
|
||||
# Abel Cheung <maddog@linux.org.hk>, 2002.
|
||||
# Yuan-Chung Cheng <platin@ms.ccafps.khc.edu.tw>, 1998.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: XXX X.X.X\n"
|
||||
"POT-Creation-Date: 2001-07-23 14:32-0400\n"
|
||||
"PO-Revision-Date: 2001-08-27 15:53+0800\n"
|
||||
"Last-Translator: Chung-Yen Chang <candyz@linux.org.tw>\n"
|
||||
"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
=============================================================================
|
||||
</programlisting>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<option>PO-Revision-Date:</option>
|
||||
此欄位就請填入您翻譯時的日期時間
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<option>Last-Translator:</option>
|
||||
最後翻譯的人,若您是最後翻的人,就填入您的資料,以便讓人有疑問時可以連絡的上。
|
||||
至於之前翻譯者的資料該如何處理呢?
|
||||
或許比較好的方式,您可以把他的資料放在最前面,並將該行以 # 開頭註解起來,
|
||||
如在 po 檔的最前面幾行加入這樣的資訊:
|
||||
<programlisting>
|
||||
# Translator: aaa <aaa@aaa.com>, bbb <bbb@bbb.com>
|
||||
# ccc <ccc@ccc.com>
|
||||
# ddd <ddd@ddd.com></programlisting>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<option>Language-Team:</option>
|
||||
若原本已是 Chinese (traditional) <zh-l10n@linux.org.tw> 那就不須要變動,
|
||||
若是新的 po 檔,則可以將其改為 Chinese (traditional) <zh-l10n@linux.org.tw>
|
||||
表示這是由我們繁體中文的翻譯小組所翻譯的。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<option>Content-Type: text/plain; charset=utf-8</option>
|
||||
字元集部份,KDE3 用 utf-8,gnome & gnu 目前還在用 big5。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<option>Content-Transfer-Encoding: 8bit</option>
|
||||
encoding 部份我們中文字都是用 8bit。
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>翻譯提示(hint) (注意, 這是 KDE 獨有的 extention),
|
||||
如底下的範例,在 msgid 中您會看到有 "_:" 開頭的字串,
|
||||
凡以 "_:" 開頭的即表示之後的字串是翻譯的提示,
|
||||
這部份是給您參考用的,所以您只要翻譯 "Screen at %1" 這行即可。</para>
|
||||
<programlisting>
|
||||
==== 翻譯提示(hint)範例 =====================================================
|
||||
#: ui/konsole_mnu.cpp:85
|
||||
#, c-format
|
||||
msgid ""
|
||||
"_: Screen is a program controlling screens!\n"
|
||||
"Screen at %1"
|
||||
msgstr ""
|
||||
"視窗於 %1"
|
||||
=============================================================================</programlisting>
|
||||
<para>翻譯者的姓名及e-mail:
|
||||
如下的範例,若碰到這樣的狀況,請填您自己的姓名及e-mail,
|
||||
千萬不要把它給翻成了 "您的姓名"、"您的電子郵件帳號"。
|
||||
ref: <ulink url="http://i18n.kde.org/translation-howto/getting-credit.html">
|
||||
Getting Credit for Your Work</ulink></para>
|
||||
<programlisting>
|
||||
==== 翻譯者的姓名及e-mail範例 ===============================================
|
||||
#: _translatorinfo.cpp:1
|
||||
msgid ""
|
||||
"_: NAME OF TRANSLATORS\n"
|
||||
"Your names"
|
||||
msgstr ""
|
||||
"張崇嚴, 張三"
|
||||
|
||||
#: _translatorinfo.cpp:3
|
||||
msgid ""
|
||||
"_: EMAIL OF TRANSLATORS\n"
|
||||
"Your emails"
|
||||
msgstr ""
|
||||
"candyz@linux.org.tw,someone@linux.org.tw"
|
||||
# ^ 註: 為了對齊, 英文逗點後勿留空白
|
||||
=============================================================================</programlisting>
|
||||
<para>HTML TAG 部份:
|
||||
如底下範例,若有 <p><b> 等 HTML TAG,
|
||||
您必須保留其語法部份。</para>
|
||||
<programlisting>
|
||||
==== HTML TAG 部份範例 ======================================================
|
||||
#: toplevel.cpp:110
|
||||
msgid "<p><b>What can I do?</b></p><p>%1</p>>"
|
||||
msgstr "<p><b>我能做什麼?</b></p><p>%1</p>"
|
||||
=============================================================================</programlisting>
|
||||
<para>快速鍵部份:
|
||||
如底下範例,若有看到 "&" 開頭的地方,如 &D,
|
||||
則表示這可能是選單中的某快速鍵,
|
||||
我們可以按 alt + d 鍵來快速執行等等,
|
||||
此部份的翻譯方式,我們則是在最後面加上 "(&D)" 來表示。</para>
|
||||
<programlisting>
|
||||
==== 快速鍵部份範例 =========================================================
|
||||
#: toplevel.cpp:61
|
||||
msgid "&Debugger"
|
||||
msgstr "除錯器(&D)" # (&D) 之前不留空格
|
||||
#: toplevel.cpp:61
|
||||
msgid "&Debugger..."
|
||||
msgstr "除錯器(&D)..." # ... 是半形 ; (&D) 要放在 ... 之前"
|
||||
#: toplevel.cpp:61
|
||||
msgid "&Debugger:"
|
||||
msgstr "除錯器(&D):" # : 是半形 ; (&D) 要放在 : 之前"
|
||||
=============================================================================</programlisting>
|
||||
<para>c-format 部份:
|
||||
如底下範例中的 %1、%2 等變數,不一定 %1 就一定在前 %2 在後,
|
||||
可以視翻譯的文法句型做適當的調整。</para>
|
||||
<programlisting>
|
||||
==== c-format 部份範例 ======================================================
|
||||
#, c-format
|
||||
msgid "%1 is beated by %2"
|
||||
msgstr "%2 擊敗 %1"
|
||||
|
||||
msgid "%s is beated by %s"
|
||||
msgstr "%2$s 擊敗 %1$s"
|
||||
^^^^ ----------------> 請注意, %2$s 代表的是 msgid 中第二個 %s
|
||||
=============================================================================</programlisting>
|
||||
<para>fuzzy(模糊)部份:
|
||||
若看到 "#, fuzzy",則表示這部份的翻譯是電腦自動猜測幫您翻的,
|
||||
有時候會對,但也有時會錯的很離譜,因此,您必須檢查一下,
|
||||
並做適當的翻譯調整調整完後,也要記得把 "#, fuzzy" 那行給拿掉。</para>
|
||||
<programlisting>
|
||||
==== fuzzy(模糊)部份範例 ====================================================
|
||||
#: ../partitioning.py:1425
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"You are about to delete a RAID device.\n"
|
||||
"\n"
|
||||
"Are you sure?"
|
||||
msgstr "您必須選擇一個磁碟陣列裝置"
|
||||
|
||||
#: ../partitioning.py:1428
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"You are about to delete the /dev/%s partition.\n"
|
||||
"\n"
|
||||
"Are you sure?"
|
||||
msgstr "您確定要刪除這個分割區嗎"
|
||||
=============================================================================</programlisting>
|
||||
<para>淘汰部份:
|
||||
有些在舊版本中有的訊息,但在新版本中已經沒有了,因此這部份就沒有用了,
|
||||
會出現在整個 po 檔的最後面部份,都以 "#~" 為開頭,
|
||||
關於這部份,您可以將它刪除掉,或是也可以將其保留,當做日後參考用也行。</para>
|
||||
<programlisting>
|
||||
==== 淘汰部份範例 ===========================================================
|
||||
#~ msgid "&About"
|
||||
#~ msgstr "關於(&A)"
|
||||
|
||||
#~ msgid "Panel Menu"
|
||||
#~ msgstr "面板選單"
|
||||
|
||||
#~ msgid "Settings..."
|
||||
#~ msgstr "設定..."
|
||||
|
||||
#~ msgid "Legacy Application"
|
||||
#~ msgstr "傳統應用程式"
|
||||
=============================================================================</programlisting>
|
||||
<para>單數複數:
|
||||
中文沒有單數複數的問題,請直接填 msgstr[0] 即可。</para>
|
||||
<programlisting>
|
||||
==== 單數複數範例 ===========================================================
|
||||
msgid "found %d fatal error"
|
||||
msgid_plural "found %d fatal errors"
|
||||
msgstr[0] "找到了 %d 個重大的錯誤"
|
||||
=============================================================================</programlisting>
|
||||
<para>其他綜合建議:</para>
|
||||
<para>標點符號請儘量用全形標點符號,但欄名尾的冒號則用回半形。</para>
|
||||
<para>提示要用 "您" 取替 "你"。</para>
|
||||
<para>編譯: msgfmt -cv xxx.po -o /dev/null</para>
|
||||
<para>安裝: msgfmt -cv xxx.po -o /usr/share/locale/zh_TW/LC_MESSAGES/xxx.mo</para>
|
||||
<para>測試: LC_MESSAGES=zh_TW.Big5 xxx ;</para>
|
||||
<para>參考資料:</para>
|
||||
<para>The KDE Translation HOWTO <ulink url="http://i18n.kde.org/translation-howto/">
|
||||
http://i18n.kde.org/translation-howto/</ulink></para>
|
||||
<para>翻譯工具 KBabel <ulink url="http://i18n.kde.org/tools/kbabel/">
|
||||
http://i18n.kde.org/tools/kbabel/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="manual">
|
||||
<title>中文 manual page</title>
|
||||
<para><application>groff</application> 有 <option>-Tlatin1</option>
|
||||
選項,目前透過這個選項來顯示中文。</para>
|
||||
<para>目前還沒有中文 manual page 的繁體翻譯計畫,不過有簡體的,
|
||||
下面是一個翻譯與使用的範例:</para>
|
||||
<programlisting>
|
||||
.Dd January 15, 1991
|
||||
.Dt APROPOS 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm apropos ,
|
||||
.Nm whatis
|
||||
.Nd 搜尋 whatis 資料庫
|
||||
.Sh 用法概要
|
||||
.Nm apropos
|
||||
.Ar 關鍵字 ...
|
||||
.Nm whatis
|
||||
.Ar 關鍵字 ...
|
||||
.Sh 詳細解說
|
||||
.Nm
|
||||
由指定的關鍵字,尋找一組含有系統命令簡短描述的資料庫檔案,
|
||||
並且將結果顯示於標準輸出。
|
||||
.Nm whatis
|
||||
只顯示整個字完全符合的結果。
|
||||
.Sh 傳回值
|
||||
.Nm
|
||||
這個命令在成功\時傳回 0,如果找不到符合的關鍵字則傳回 1。
|
||||
.Sh 請參考
|
||||
.Xr makewhatis 1 ,
|
||||
.Xr man 1</programlisting>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mkdir -p /usr/local/man/zh_TW.Big5/man1</userinput>
|
||||
&prompt.root; <userinput>cd /usr/local/man/zh_TW.Big5/man1</userinput>
|
||||
&prompt.root; <userinput>zcat /usr/share/man/man1/whatis.1.gz > whatis.1</userinput>
|
||||
&prompt.root; <userinput>vi whatis.1</userinput>
|
||||
&prompt.root; <userinput>cat whatis.1 | groff -man -Tlatin1</userinput></screen>
|
||||
<figure>
|
||||
<title>man snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/man" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
目前在 outta-ports 中有類似的測試 port,可以試用看看。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/man-doc</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput>
|
||||
&prompt.root; <userinput>cman whatis</userinput></screen>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.cmpp.net/">
|
||||
CMPP 中文MAN-PAGE計劃</ulink>(簡體)</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.25
|
||||
-->
|
||||
|
||||
<chapter id="multimedia">
|
||||
<title>中文多媒體軟體</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="mplayer">
|
||||
<title>mplayer</title>
|
||||
<para>Last Update: 2003年 1月16日 周四 02時53分21秒 CST</para>
|
||||
<para>
|
||||
支援了眾多電影播放格式,舉凡常見的 mpeg,dat 和微軟的 avi,
|
||||
就連現在最新的 divx4 也直接支援。</para>
|
||||
<para><filename role="package">multimedia/mplayer</filename> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/multimedia/mplayer</userinput>
|
||||
&prompt.root; <userinput>make WITH_LANG=zh install clean</userinput></screen>
|
||||
<para>目前讓 mplayer 能夠顯示中文字幕的方式有三種,
|
||||
前兩種使用 mplayer 自訂的字型檔,目前已經少用。
|
||||
一個是安裝由 mplayer 所提供的字型檔,
|
||||
可以在 <ulink url="ftp://ftp.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts">
|
||||
ftp://ftp.mplayerhq.hu/MPlayer/contrib/fonts/chinesefonts</ulink>
|
||||
找到,另一個就是使用
|
||||
<filename role="package">chinese/mplayer-fonts</filename>
|
||||
來將 TrueType 轉換成 mplayer 所需要的字型檔。</para>
|
||||
<para>直接使用 mplayer 所提供的字型檔,可以到上述的網址中找您要的語言,
|
||||
以繁體楷書為例就是 big5-kai.tar.bz2,
|
||||
下載後解開會出現 big5-kai 的目錄就以用了。
|
||||
下面的例子使用宋體 16pt 來顯示中文字幕,還有宋體 24pt 可用,或是中楷
|
||||
bkai00mp16 與 bkai00mp24。簡體字幕可以用 iconv 等軟體轉換 .srt,
|
||||
將簡體轉換成繁體,或是使用 gbsn00lp16 等字型來觀賞。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mplayer -font /usr/local/share/mplayer/fonts/big5-ming/bsmi00lp16/font.desc -sub 1.srt -unicode 1.avi</userinput></screen>
|
||||
<note><para>如果要全螢幕按 <command>f</command> 就可以囉。<para></note>
|
||||
<para>最後一個就是在編譯 mplayer 的時候,指定 mplayer 使用 freetype,
|
||||
讓他能直接使用 TrueType 字型,但是一但指定了使用 freetype,
|
||||
就不能選擇使用 mplayer 的字型檔。
|
||||
目前的 <filename role="package">multimedia/mplayer</filename>
|
||||
已經預設 WITH_FREETYPE 了,不需要安裝中文字幕字型。<para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>ln -s /usr/local/share/fonts/TrueType/bsmi00lp.ttf ~/.mplayer/subfont.ttf</userinput>
|
||||
&prompt.root; <userinput>mplayer -subcp cp950 -sub 1.srt 1.avi</userinput></screen>
|
||||
<figure>
|
||||
<title>mplayer snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/mplayer" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.mplayerhq.hu/">
|
||||
http://www.mplayerhq.hu/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="xmms">
|
||||
<title>xmms - mp3 播放軟體</title>
|
||||
<para>
|
||||
mp3 播放軟體,有 <application>Winamp</application>
|
||||
的好看介面,可以看到中文的選歌單,
|
||||
介面也是中文的,目前可以演奏 mpeg1、mpeg2、mpeg3、wav、
|
||||
au 和 CD audio。也可以經由 <application>xmms</application>
|
||||
的外掛來使用其他的格式,
|
||||
例如:<application>xmms-mikmod</application>。</para>
|
||||
<para>安裝 <filename role="package">chinese/xmms</filename>。</para>
|
||||
<para>安裝完如果發現選項中文有問題,檢察一下是否有設定
|
||||
<filename>~/.gtkrc</filename>,
|
||||
如果沒有請參考 <link linkend="gnome">GNOME 程式的中文支援</link>,
|
||||
如果是 PlayList 中文有問題,檢察一下
|
||||
<filename>~/.xmms/config</filename> 的
|
||||
<option>playlist_font</option> 與 <option>mainwin_font</option>,
|
||||
通常筆者都是如下的設定:</para>
|
||||
<screen>
|
||||
playlist_font=-adobe-helvetica-bold-r-*-*-10-*,-*-medium-r-*-12-*-big5-0
|
||||
use_fontsets=TRUE
|
||||
mainwin_use_xfont=TRUE
|
||||
mainwin_font=-adobe-helvetica-medium-r-*-*-8-*,-*-medium-r-*-12-*-big5-0</screen>
|
||||
<note><para>在 KDE 底下執行 XMMS 有時會出現無法開啟音效的錯誤,
|
||||
進入 XMMS 的偏好設定,將輸出的模組改為 arts 即可,
|
||||
因為在 KDE 下管理聲音的伺服器是 arts。</para></note>
|
||||
<para>SKIN 的部分去 <ulink url="http://www.xmms.org/skins.html">
|
||||
http://www.xmms.org/skins.html</ulink> 找一下喜歡的 SKIN 吧,
|
||||
下載下來後,將該檔案拷貝至 <filename>~/.xmms/Skins</filename>
|
||||
就可以了。</para>
|
||||
<figure>
|
||||
<title>xmms snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/xmms" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.xmms.org/">http://www.xmms.org/</ulink>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,859 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.89
|
||||
-->
|
||||
|
||||
<chapter id="net">
|
||||
<title>中文網際網路軟體</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="bind8">
|
||||
<title>bind8</title>
|
||||
<para>chinese bind8 is just for 8-bit Domain Name , nothing need to document.</para>
|
||||
<para>安裝 <filename role="package">chinese/bind8</filename>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="samba">
|
||||
<title>samba - 網路芳鄰,資源分享程式</title>
|
||||
<para>Last Update: 2003年 1月25日 周六 12時24分45秒 CST</para>
|
||||
<para>
|
||||
<application>samba</application> 是一個能把您的 Unix
|
||||
電腦和其他 MS Windows 電腦相互共享資源的軟體。 </para>
|
||||
<para>
|
||||
<application>samba</application> 提供有關於資源分享的三個功能。
|
||||
包括 <command>smbd</command>,執行了它,就可以使這台
|
||||
Unix 能夠共享資源給其他的電腦,而 <command>smbclient</command>
|
||||
就是讓這台 Unix 去存取其他電腦的資源了,最後一個
|
||||
<command>smbmount</command>,則是類似 MS Windwos
|
||||
下『網路磁碟機』的功能,可以讓您把其他電腦的資源
|
||||
掛在自己的檔案系統下。 </para>
|
||||
<para>安裝 <filename role="package">net/samba</filename>。</para>
|
||||
<para>
|
||||
設定檔修改 <filename>/usr/local/etc/smb.conf</filename>,
|
||||
才算完整支援中文,在 [global] 中找到 <option>for Traditional
|
||||
Chinese Users</option> 的設定區,將 <option>client code
|
||||
page=950</option> 前面的 ; 拿掉
|
||||
,不要動 <option>coding system=cap</option>,並在後面加上
|
||||
<option>valid chars = 0xb9</option>。 </para>
|
||||
<programlisting>
|
||||
[global]
|
||||
# for Traditional Chinese Users
|
||||
client code page=950
|
||||
; coding system=cap
|
||||
valid chars = 0xb9 </programlisting>
|
||||
<para>關於 valid chars = 0xb9,這個好像是很久前遇過的一個小問題,
|
||||
如果您在 smb.conf 中設定 "workgroup = 電腦",
|
||||
這時候用網芳去瀏覽會發現出現的是 "鄒腦",
|
||||
電=0xb971 鄒=0xb951 q=0x71 Q=0x51,
|
||||
samba 在遇到 0xb9 後,自動把下一個字元轉成大寫了,
|
||||
如果設定 valid chars = 0xb9 就會正常。</para>
|
||||
<para>而這邊會出現 <option>coding system=cap</option> 則是天大的錯誤,
|
||||
十分容易誤導使用者,以下摘錄 <filename>smb.conf.5</filename>:</para>
|
||||
<programlisting>
|
||||
coding system (G)
|
||||
|
||||
This parameter is used to determine how incoming Shift-JIS Japanese
|
||||
characters are mapped from the incoming client code page used by the
|
||||
client, into file names in the UNIX filesystem. Only useful if client
|
||||
code page is set to 932 (Japanese Shift-JIS). The options are :
|
||||
|
||||
* CAP - Convert an incoming Shift-JIS character to the 3 byte
|
||||
hex representation used by the Columbia AppleTalk Program (CAP),
|
||||
i.e. :AB. This is used for compatibility between Samba and CAP.
|
||||
|
||||
Default: coding system = <empty value></programlisting>
|
||||
<para>在網芳上的名稱通常都要自己加上 <option>netbios name =
|
||||
Elf</option>,其中的 Elf 就是網芳上的名稱。 </para>
|
||||
<para>另一個 samba 的中文問題是 <filename>smb.conf</filename>
|
||||
不能設定某些字為 Section,例如:</para>
|
||||
<programlisting>
|
||||
;[設計與科技]
|
||||
[計與科技]
|
||||
comment= 設計與科技
|
||||
browseable = yes
|
||||
path = /home/design
|
||||
read only = yes
|
||||
guest ok = yes</programlisting>
|
||||
<para>因為 "設" 的第二個字元是 "]" 與 samba 的 Section 字元衝突,
|
||||
所以解決的方法就是去修改 <filename>source/param/param.c</filename>:</para>
|
||||
<programlisting>
|
||||
--- params.c.orig Mon May 12 19:46:29 2003
|
||||
+++ params.c Mon May 12 20:37:24 2003
|
||||
@@ -297,6 +297,15 @@
|
||||
i = end + 1;
|
||||
c = EatWhitespace( InFile );
|
||||
}
|
||||
+ else if ( c > 0x80 )
|
||||
+ {
|
||||
+ bufr[i++] = c;
|
||||
+ end = i;
|
||||
+ c = mygetc( InFile );
|
||||
+ bufr[i++] = c;
|
||||
+ end = i;
|
||||
+ c = mygetc( InFile );
|
||||
+ }
|
||||
else /* All others copy verbatim. */
|
||||
{
|
||||
bufr[i++] = c;</programlisting>
|
||||
<para>samba 大部分的程式都有中文問題,需要更多人去 patch,
|
||||
像是 smbclient 去看 MicroSoft 的中文資料夾會是底線(_)。</para>
|
||||
<note><para><application>samba</application> 是用TCP/IP通訊協定,所以在
|
||||
MS Windows端的電腦也要裝上TCP/IP協定,不然就不能用囉。</para></note>
|
||||
<para>而 samba 3.x 的部分可以透過 samba-devel 來安裝,
|
||||
但是預設沒有支援 I18N,所以必須透過以下的方式來安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/net/samba-devel</userinput>
|
||||
&prompt.root; <userinput>make -DWITH_LIBICONV all install clean</userinput></screen>
|
||||
<programlisting>
|
||||
mangling method = hash
|
||||
unicode = on
|
||||
dos charset = UCS-2LE
|
||||
unix charset = CP950
|
||||
display charset = CP950</programlisting>
|
||||
<para>WWW: <ulink url="http://www.samba.org/">
|
||||
http://www.samba.org/</ulink> </para>
|
||||
<para>Online Book - Using Samba:
|
||||
<ulink url="http://www.oreilly.com/catalog/samba/">
|
||||
http://www.oreilly.com/catalog/samba/</ulink> </para>
|
||||
<para>如果要方便的使用網芳上的東西,就要裝
|
||||
<application>smbfs</application> 這個軟體,在
|
||||
<filename>net/smbfs</filename> 底下,裝好後還需要重編 kernel,
|
||||
將 <option>options LIBMCHAIN</option> 和
|
||||
<option>options LIBICONV</option> 編進去才行。
|
||||
4.5-RELEASE 之後已經不需要重新編譯 kernel 了。</para>
|
||||
<para>然後只要用 <command>mount_smbfs -I host //user@server/share
|
||||
/smb/node</command> 就可以方便的使用網芳囉。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="konqueror">
|
||||
<title>Konqueror - KDE 內建的瀏覽器</title>
|
||||
<para>
|
||||
<application>Konqueror</application> 是
|
||||
<application>KDE</application> 內建的瀏覽器,
|
||||
在各方面的支持都都十分完善。</para>
|
||||
<figure>
|
||||
<title>konqueror snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konqueror" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mozilla">
|
||||
<title>mozilla-tclp - Mozilla 繁體中文語言包</title>
|
||||
<para>Mozilla 是一個開放原始碼的網頁瀏覽器,設計方向是順從標準、
|
||||
高性能和可移植性。 </para>
|
||||
<para>Mozilla 繁體中文語言包(Traditional Chinese Language Pack)
|
||||
提供一個 L10N 的環境給 Big5 的使用者。 </para>
|
||||
<para>在安裝完後,選擇 View -> Languages and Web Content -> Tradition
|
||||
Chinese (zh-TW),然後關閉後從開就有中文的介面了。</para>
|
||||
<para><application>Mozilla</application>
|
||||
在中文輸入及顯示方面並沒有什麼問題,但在列印部份,請修改一下
|
||||
<filename>/usr/X11R6/lib/mozilla/defaults/pref/unix.js</filename>
|
||||
加入中文的 ps font :</para>
|
||||
<programlisting>
|
||||
pref("print.psnativecode.zh-TW", "big5");
|
||||
pref("print.psnativefont.zh-TW", "ShanHeiSun-Light-ETen-B5-H");</programlisting>
|
||||
<para>並安裝 print/adobe-cmaps 與 print/ghostscript-gnu-commfont
|
||||
取得 ETen-B5-H 的 CMap name,
|
||||
以及將 <filename>bsmi00lp.ttf</filename> 用
|
||||
<command>ttfm.sh --add bsmi00lp.ttf</command> 取得
|
||||
ShanHeiSun-Light 的 CIDFont name,這是 CID-Keyed Font
|
||||
的兩個組成要素。也可以用 <command>ttfm.sh --list | grep ETen-B5-H
|
||||
</command> 來看看有那些可以用的字型。</para>
|
||||
<para>如果直接用編輯器去看 .ps 則會發現有一段:</para>
|
||||
<programlisting>
|
||||
/Unicode2NativeDictzh-TW 0 dict def
|
||||
/zh-TW_ls {
|
||||
/NativeFont /ShanHeiSun-Light-ETen-B5-H def
|
||||
/UCS2Font /Courier def
|
||||
/Unicode2NativeDict Unicode2NativeDictzh-TW def
|
||||
/unicodeshow1 { real_unicodeshow } bind def
|
||||
/unicodeshow2 { real_unicodeshow_native } bind def
|
||||
} bind def</programlisting>
|
||||
<para>並且原來的 default_ls 會變成 zh-TW_ls。</para>
|
||||
<para>在 0.9.8 時所用的是 <option>print.psnativecode.zh-TW</option>
|
||||
和 <option>print.psnativefont.zh-TW</option>,到了 0.9.9
|
||||
分得更細,ps 單獨當一「層」,變成
|
||||
<option>print.postscript.nativecode.zh-TW</option> 和
|
||||
<option>print.postscript.nativefont.zh-TW</option>。</para>
|
||||
<para>另外解釋一下 ports 中 files/ 底下的東西。Mozilla 把它的
|
||||
resource 用一種很特殊的機制管理。當我們安裝東西時,它會記錄到
|
||||
installed-chrome.txt (所以 files 底下的這個檔偶爾會變,因為
|
||||
language pack 內容若有新增/刪改它也會跟著變)然後,
|
||||
all-locales.rdf 及 user-locales.rdf (存在於以前 keith 的 tclp)
|
||||
是 Mozilla 參考 installed-chrome.txt 而做出來的檔案。
|
||||
所以這兩個檔理論上是不應該擺在 ports 的 files 的
|
||||
(應該讓 Mozilla 產生), 以前 keith 是在自己的電腦上先跑過,
|
||||
然後抓產生出來的 rdf... 這就好像 FreeBSD 的 package, 會有
|
||||
dependency 的問題。所以我把這兩個檔案拿掉, 改成在 Makefile
|
||||
裡讓 mozilla 產生(這樣才像 ports 嘛 :P)。</para>
|
||||
<para>不過直接使用 CIDKeyed-font 可能沒辦法直接送印表機列印,
|
||||
要解決此問題可利用 <command>ps2ps</command> 指令,
|
||||
將原 PostScript 文件轉成內嵌的 PostScript 文件。
|
||||
這樣子需要兩道步驟,沒辦法直接取代原列印指令欄的
|
||||
<command>lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}</command>,
|
||||
所以就必須改成比較複雜的方式:</para>
|
||||
<programlisting>
|
||||
gs -q -sDEVICE=pswrite "-sOutputFile=/tmp/out.ps" \
|
||||
"-dNOPAUSE -dBATCH -dSAFER" && \
|
||||
lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME} \
|
||||
/tmp/out.ps && rm -f "/tmp/out.ps"</programlisting>
|
||||
<para>如果選擇了 <application>mozilla</application> 當作您的瀏覽器,
|
||||
那麼一定要裝一下 <filename>x11-fonts/mozilla-fonts</filename>
|
||||
或是 <filename>x11-fonts/webfonts</filename>,
|
||||
前者是專門為 mozilla 所打造出來的 pcf fonts,
|
||||
後者則是 ms 的 truetype fonts。</para>
|
||||
<para>如果要看 flash 的話也可以裝
|
||||
<filename>www/flashplugin-mozilla</filename>。</para>
|
||||
<para>另一個 Mozilla 的中文問題是當使用 Mozilla 的網址列中文使用
|
||||
Google 搜尋變問號字串,可以透過以下的修正方式:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/X11R6/lib/mozilla/searchplugins</userinput>
|
||||
&prompt.root; <userinput>fetch http://www.google.com/mozilla/google.src</userinput></screen>
|
||||
<para>或是安裝 <filename role="package">chinese/mozilla-tclp</filename>
|
||||
,這個 port 也會修正這些問題,不過方式不ㄧ樣。</para>
|
||||
<para>現在的 mozilla 已經使用 XFT,所以一開始使用可能會找不到字體,
|
||||
可以經由 <command>env GDK_USE_XFT=0 mozilla &</command>
|
||||
的方式來執行 mozilla 讓他不採用 XFT,或是利用
|
||||
<command>fc-cache -f -v</command> 來設定 XFT。
|
||||
而中文馬賽克的問題可以加裝 <filename role="package">x11-fonts/webfonts
|
||||
</filename> 來修復,或是在字型選擇的地方將
|
||||
<option>Allow documents to use other fonts</option> 關閉。</para>
|
||||
<note><para>常遇到的小問題是工具列的字很小,卻又不知道從那調整。
|
||||
其實 <application>mozilla</application> 還有 Chrome 的設定檔,
|
||||
在 <filename>~/.mozilla/default/5e7k96bg.slt/chrome/userChrome.css</filename>,
|
||||
只要設定如下就可以了:</para>
|
||||
<programlisting>/* Make all the default font sizes 16 pt: */
|
||||
* {
|
||||
font-size: 16pt !important
|
||||
}</programlisting></note>
|
||||
|
||||
<figure>
|
||||
<title>mozilla snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/mozilla" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>L10N WWW: <ulink url="http://www.csie.ntu.edu.tw/~b7506051/mozilla/">
|
||||
http://www.csie.ntu.edu.tw/~b7506051/mozilla/</ulink> </para>
|
||||
<para>WWW: <ulink url="http://www.mozilla.org/">
|
||||
http://www.mozilla.org/</ulink></para>
|
||||
</sect1>
|
||||
<sect1 id="lynx">
|
||||
<title>lynx - console 網頁瀏覽器</title>
|
||||
<para>安裝 <filename role="package">www/lynx</filename>。</para>
|
||||
<para><ulink url="http://lynx.browser.org/">lynx</ulink> v2.7 之後已經
|
||||
可直接接觀看中文的網頁了。 </para>
|
||||
<para>由於設定檔常常防寫,所以先開啟寫的權限。<command>chmod u+w
|
||||
/usr/local/etc/lynx.cfg</command>。 </para>
|
||||
<para>執行 <application>lynx</application>,按
|
||||
<option>O)ption</option>,<option>Display character set
|
||||
</option>,按上下鍵選 <option>Taipei(Big5)</option>,再選
|
||||
<option>Assumed document character set</option>,按上下鍵選
|
||||
<option>big5</option>, 再存檔即可。 </para>
|
||||
<para>或是修改 /usr/local/etc/lynx.cfg </para>
|
||||
<programlisting>
|
||||
CHARACTER_SET:big5
|
||||
ASSUME_CHARSET:big5
|
||||
PREFERRED_LANGUAGE:zh-TW </programlisting>
|
||||
<para>抑或是 lynx -assume_charset=big5 -assume_local_charset=big5。</para>
|
||||
<figure>
|
||||
<title>lynx snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/lynx" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>lynx WWW: <ulink url="http://lynx.isc.org/current/">
|
||||
http://lynx.isc.org/current/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="w3m">
|
||||
<title>w3m - console 網頁瀏覽器</title>
|
||||
<para>目前比較常用,且支援中文的 console 瀏覽器有 lynx 和
|
||||
w3m 兩套,雖然 lynx 在處理網頁上並不是很漂亮,
|
||||
不過使用的人口不少,所以還是介紹一下關於中文方面的設定。</para>
|
||||
<para>不過建議您使用 <application>w3m</application>,
|
||||
<application>w3m</application> 在排版的部份比
|
||||
<application>lynx</application> 好很多。 </para>
|
||||
<para>安裝 <filename role="package">www/w3m</filename>。</para>
|
||||
<para>w3m WWW: <ulink url="http://w3m.sourceforge.net/">
|
||||
http://w3m.sourceforge.net/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="links">
|
||||
<title>links - 現在的預設 console 瀏覽器</title>
|
||||
<para>安裝 <filename role="package">chinese/links</filename>,
|
||||
這包含中文修補檔。</para>
|
||||
<para>在 <option>-g</option> 的模式下無法正確的看到中文。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="netscape">
|
||||
<title>netscape [OBSOLETED]</title>
|
||||
<para>netscape47-* linux-netscape47-*</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
完整中文支援,感謝許多先進的幫忙,選單/設定/訊息全都是中文
|
||||
,沒有用到任何 hack 來修正亂碼的問題,自然就不會出現一堆狀
|
||||
況。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
分成 <application>communicator</application> &
|
||||
<application>navigator</application>,可以選擇適合的,並且這樣比
|
||||
較符合 official port layout,以後要加 slave port 會相當容
|
||||
易。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
名稱改成像
|
||||
<application>zh-tw-netscape-communicator-4.75</application> 或
|
||||
zh-cn-netscape-...,目前暫時把支援大陸 GB 的部份拿掉,如果
|
||||
有人需要簡體支援再加上去。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
加入 Big5 版的 <application>nethelp</application>,這部份是從
|
||||
<application>Netscape</application> 網站拿下來的,
|
||||
所以不會像 <application>sysware</application>
|
||||
的翻譯會有版權問題,"輔助->內容" 就可以看到
|
||||
<application>nethelp</application>。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
新增 <filename>netscape.cfg</filename>。由於
|
||||
resource 檔沒辦法將右邊的輔助選單轉成中文,必須用
|
||||
<filename>netscape.cfg</filename> 才看得到。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
<filename>preferences.js</filename>,指定內定使用的語言和字型。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Wheel Mouse 設定。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Navigator/Composer root/overthespot XIM input styles.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>可以加強的地方:</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
中文 Java applet 資源吃太兇
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
開檔案時,netscape47-* 會直接跳到根目錄,linux-netscape47-*
|
||||
很正?但會漏檔案(這應該是 linuxulator 的問題),不過
|
||||
<application>ja-netscape</application> 沒有這種問題,看來是
|
||||
<filename>Netscape.ad/netscape.cfg/preference.js</filename>
|
||||
的設定。
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
列印用的字型最好改成比較漂亮的 <application>arphic</application>
|
||||
,而不是現在的
|
||||
<application>moe</application>。
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
<application>netscape</application> 和
|
||||
<application>linux-netscape</application> 不同的地方:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<application>linux-netscape</application> 有比較多的
|
||||
<application>plugin</application>,像
|
||||
<application>acrobat realplayer</application>,
|
||||
<application>netscape</application> 要加額外的軟體,像
|
||||
<application>plugger</application> 或
|
||||
<application>xswallow</application>
|
||||
(也許以後可以加進這些設定檔)
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
目前 port 下裝的 XFree86 a.out library 由於是針對 FreeBSD
|
||||
2.x 的版本,所以處理 Big5 還是有問題(沒有 GLGR patch),必
|
||||
須要作個新的 libX11,安裝上會比較花時間。
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.netscape.org/">
|
||||
http://www.netscape.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="iglooftp">
|
||||
<title>IglooFTP</title>
|
||||
<para>這個軟體最主要的特點就是容易使用,並且對初學 FTP
|
||||
者有著直覺化的操作設計。而老手們也可以發現他功能強大、
|
||||
可以調整許多設定選項,以符合經驗老練的使用者們的需求。 </para>
|
||||
<para>很多的選擇項都可點選相關的圖示來完成,有快速的工具列、
|
||||
快速連線列、和本地端的圖形化目錄瀏覽視窗,漂亮的檔案相關圖示,
|
||||
並且還有 Netscape 的小工具列。 </para>
|
||||
<para>連線的資料庫管理上,使用了樹狀階層式的站台方法,每一個 ftp
|
||||
site 以及 group 的資料都能很容易地被調整。另外還有不同使用者
|
||||
(user profile)的管理、遠端控制一台 FTP server 到 FTP client
|
||||
傳輸資料(FXP transfers)、URL 剪貼簿中的監控、防火牆的支援(
|
||||
包括了SOCKS 5、ftp-gw、WinGate proxy等等)、遠端目錄的快取功能
|
||||
、佇列(queue)管理、還有許多進階的使用者命令等等。 </para>
|
||||
<para>安裝 <filename role="package">ftp/IglooFTP</filename>。</para>
|
||||
<para>安裝完如果發現選項中文有問題,檢察一下是否有設定
|
||||
<filename>~/.gtkrc</filename>,如果沒有請參考
|
||||
<link linkend="gnome">GNOME 程式的中文支援</link>。</para>
|
||||
<figure>
|
||||
<title>IglooFTP snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/IglooFTP" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para> WWW: <ulink url="http://www.littleigloo.org/iglooftp.php3">
|
||||
http://www.littleigloo.org/iglooftp.php3</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gftp">
|
||||
<title>gftp - gtk ftp</title>
|
||||
<para>安裝 <filename role="package">ftp/gftp</filename>,
|
||||
可以用 <option>WITH_GTK2=yes</option> 來裝 GTK2 的版本。 </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="ncftp3">
|
||||
<title>NcFTP3</title>
|
||||
<para>當我們在用許多文字介面的FTP程式時,常為了要抓一個檔或是一個目錄
|
||||
,往往就要輸入一些又臭又長的名稱,但如果我們使用了 NcFTP,
|
||||
您只要輸入檔名或目錄名的前幾個字元,它就會自動幫您搜尋檔案或
|
||||
目錄的名稱,使您減少了許多打字的時間。 </para>
|
||||
<para>不只如此,當您覺得一個 FTP 站不錯,您也可以用 NcFTP
|
||||
把這個站記錄下來,不僅它可以記錄帳號和密碼,
|
||||
它連路徑也一併記下了,當您下一次想連回原站時,
|
||||
只要再從選單中選一下,就可輕鬆的連回去。 </para>
|
||||
<para>除此之外,NcFTP 也擁有不少小功能,它可以線上看文字檔,
|
||||
線上去改變檔案的存取權限或名稱。而當您用 NcFTP 傳輸大檔案時,
|
||||
您可以把它丟入背景執行,使您瀏覽檔案的動作不會中斷。
|
||||
如果您想要用最基本的 FTP 傳輸語言測試遠端伺服器,也可以用 NcFTP。</para>
|
||||
<para>也是在終端機底下可以輸入中文的 FTP 軟體,不過版本要是 3.0.2
|
||||
或是之後的版本。 </para>
|
||||
<para>安裝 <filename role="package">ftp/ncftp3</filename>。</para>
|
||||
<para>在 NcFTP 上使用 <command>ls</command> 可以正常的看到中文,
|
||||
可是 <command>lls</command> 卻不能,而且有特殊字元時也會不正常,
|
||||
於是有以下的解法,在啟動時加上 <option>env
|
||||
LC_CTYPE=en_US.ISO_8859-1</option>,在傳特殊檔案時加上雙引號。</para>
|
||||
<programlisting>
|
||||
env LC_CTYPE=en_US.ISO_8859-1 ncftp3 -u statue localhost
|
||||
ncftp /usr/home/statue > mkdir "成功"
|
||||
ncftp /usr/home/statue > ls
|
||||
成功/
|
||||
ncftp /usr/home/statue > lls
|
||||
成功/</programlisting>
|
||||
<figure>
|
||||
<title>ncftp3 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/ncftp3" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.NcFTP.com">
|
||||
http://www.NcFTP.com</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bbsnet">
|
||||
<title>bbsnet - BBS 跨海大橋</title>
|
||||
<para><application>bbsnet</application> 是 BBS 以前常提供的一項服務,
|
||||
後來因為管理上的問題,現在比較少見了。
|
||||
它提供了類似書籤的功能,能快速的讓您連結到常用的 BBS 站台。</para>
|
||||
<para>安裝 <filename role="package">net/bbsnet</filename>。</para>
|
||||
<figure>
|
||||
<title>bbsnet snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/bbsnet" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://linux.ee.tku.edu.tw/~kids/">
|
||||
http://linux.ee.tku.edu.tw/~kids/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="qterm">
|
||||
<title>qterm - 好用的 BBS 連線軟體</title>
|
||||
<para><application>qterm</application> 是目前在 Unix 中,
|
||||
還算不錯的 BBS 連線軟體,由 qt 函式庫寫成的,
|
||||
除了安裝需要 qt 外,其餘在使用上都還算不錯,
|
||||
而且支援 auto-reply,anti-idle,另外還有 Mouse Support,
|
||||
可以不需要按鍵盤就可以在 BBS 中看文章,選擇討論區,
|
||||
整體上而言,這是一套很適合 BBS 使用的連線軟體了。</para>
|
||||
<para>目前這套軟體已經在 ports 中了,可以很方便的安裝。</para>
|
||||
<para>在 qterm-1.x 字型選擇上,筆者偏好使用 sony-fixed,也就是在選項的
|
||||
Fixed[sony],其他的 TrueType 都因為字距不固定,
|
||||
容易造成畫面有些字會破碎。</para>
|
||||
<para>不過 qterm-2.x 已經可以使用文鼎字體了,
|
||||
英文介面可以在 <option>View -> Language -> Traditional Chinese</option>
|
||||
中切換成繁體中文,不過要關閉後重新開啟。</para>
|
||||
<para>而中文的輸入和顯示也需要設定,預設是 GBK,
|
||||
經由 <option>Option -> Preference -> Input Method 選擇 Big5</option>
|
||||
,以及 <option>在每個連線的 Advanced -> Display -> BBS Encoding 選擇 BIG5,Display Code 選擇 BIG5</option> 即可。</para>
|
||||
<figure>
|
||||
<title>qterm snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/qterm" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://sourceforge.net/projects/qterm/">
|
||||
http://sourceforge.net/projects/qterm/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="telnet">
|
||||
<title>telnet - Telnet 的中文問題</title>
|
||||
<para>如果您在自己的機器上可以輸入中文,但
|
||||
<application>telnet</application> 到別的機器後卻無
|
||||
法輸入中文,那麼問題可能出在
|
||||
<application>telnet</application> 程式上。
|
||||
當您還在 <application>telnet</application> 連線中時可以按
|
||||
<command>Ctrl-]</command> 跳出,在
|
||||
<prompt>telnet></prompt> 提示符號下輸入
|
||||
<command>set binary</command> 即可。
|
||||
或是在 <filename>~/.telnetrc</filename> 加上
|
||||
<option>DEFAULT set binary</option>。
|
||||
您也可以在連線時用 <command>telnet -8 host -port</command>。
|
||||
但是在連某些 SunOS 時會出問題。
|
||||
<para>另一個辦法是直接改用可傳輸 8-bit 的
|
||||
<application>telnet</application> 程式,也就是安裝在 ports
|
||||
中的 <filename role="package">chinese/telnet</filename>,
|
||||
然後用 <command>zh-telnet</command> 來連線。 </para>
|
||||
<para>在安裝 <filename role="package">chinese/telnet</filename> 前,
|
||||
必須先有 <filename>/usr/src/usr.bin/telnet</filename>,
|
||||
否則會出現以下的訊息:</para>
|
||||
<screen>
|
||||
===> zh-telnet-1.0 is marked as broken: You need to build this port with
|
||||
/usr/src/usr.bin/telnet.</screen>
|
||||
<para>以下是從光碟機安裝 /usr/src/usr.bin/telnet:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mount /cdrom</userinput>
|
||||
&prompt.root; <userinput>cd /cdrom/src/</userinput>
|
||||
&prompt.root; <userinput>./install.sh ubin</userinput></screen>
|
||||
<para>然後再到 ports 底下安裝 <filename role="package">chinese/telnet</filename>。</para>
|
||||
<para>WWW: <ulink url="http://www.freebsd.org/cgi/query-pr.cgi?pr=6144">
|
||||
http://www.freebsd.org/cgi/query-pr.cgi?pr=6144</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="licq">
|
||||
<title>licq - ICQ clone</title>
|
||||
<para>它是一個用 C++ 語言撰寫的非官方 ICQ clone。</para>
|
||||
<para>裝完 <filename>ports/net/licq</filename> 後,
|
||||
選擇 <filename>ports/net/licq-console</filename>
|
||||
或是 <filename>ports/net/licq-qt-gui</filename> 來安裝。</para>
|
||||
<para>licq-qt-gui 中文設定: System -> Options -> Font -> Select Font
|
||||
-> Chinese Font</para>
|
||||
<figure>
|
||||
<title>licq snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/licq" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.licq.org/">
|
||||
http://www.licq.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gaim">
|
||||
<title>gaim - ICQ, MSN Clone</title>
|
||||
<para><application>gaim</application> 支援十分多種格式的線上溝通軟體。</para>
|
||||
<para>由於目前 ports/net/gaim 還不支援 I18N,所以請用 ports/korean/gaim
|
||||
暫時替代。</para>
|
||||
<para>安裝 <filename role="package">net/gaim</filename>。</para>
|
||||
<para>Blishs 來信告知,
|
||||
目前 <filename>net/gaim</filename> 已經支援 I18N。
|
||||
在我測試後發現可以,不過要設定一些東西:
|
||||
工具 -> 偏好設定 -> 交談 -> 忽略字型。</para>
|
||||
<para>如果選單中文有問題,請參考
|
||||
<link linkend="gnome">GNOME 程式的中文支援</link>。</para>
|
||||
<para>要使用 ICQ 就直接在帳號與密碼的地方設定好 ICQ 的帳號,
|
||||
通訊協定則是選擇:<option>AIM / ICQ</option>,
|
||||
其他使用預設值即可。</para>
|
||||
<para>要使用 MSN 則在登入畫面先選擇 <option>插件(Plugin)</option>,
|
||||
選擇 <option>讀取</option>,並將 <option>libmsn.so</option>
|
||||
選擇進來,這麼在通訊協定就會多一個 MSN 的選項。
|
||||
接著在帳號與密碼的地方設定好 MSN 的帳號,
|
||||
通訊協定則是選擇:<option>MSN</option>,其他使用預設值即可。</para>
|
||||
<para>進入後,中文字體在接收訊息的部份會有問題,
|
||||
工具 -> 偏好設定 -> 交談 -> 忽略字型,這樣子做就可以解決了。</para>
|
||||
<para>如果遇到顯示字型過小的問題,檢察一下 <filename>~/.gtkrc</filename>
|
||||
,通常我的字型都是設 16。</para>
|
||||
<para>gaim 0.58 的預設圖示有點大,可以
|
||||
<option>偏好設定 -> 介面 -> 好友清單顯 -> 顯示好友圖示</option>。</para>
|
||||
<para>若是習慣使用 KDE 介面的話,可以使用
|
||||
<filename role="package">net/kmerlin</filename> 或是
|
||||
<filename role="package">net/kmess</filename>。</para>
|
||||
<figure>
|
||||
<title>gaim snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/gaim" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<figure>
|
||||
<title>kmerlin snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/kmerlin" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.marko.net/gaim/">
|
||||
http://www.marko.net/gaim/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="perl-oicq">
|
||||
<title>oicq - 騰訊 QQ</title>
|
||||
<para>最新版本:Version 0.7, Date June 29, 2003</para>
|
||||
<para><application>oicq</application> 是一套在中國十分流行的即時傳訊服務,
|
||||
就像是 ICQ、MSN 一樣,不過在中國的用戶群遠高過其他即時傳訊,
|
||||
但是<ulink url="http://www.tencent.com/">騰訊</ulink>
|
||||
的政策讓第三方廠商完全無法介入,雖然有 gaim 的 libqq 模組,
|
||||
但是在壓力下不能開放原始碼,因此也沒有辦法順利的在 FreeBSD 底下使用。
|
||||
perl-oicq 找出了認證與基本的溝通方式,
|
||||
利用 perl 可以簡單的在文字介面上使用 QQ,功能是沒有圖形介面的強,
|
||||
不過基本的使用應該足夠。</para>
|
||||
<note><para>由於 <application>oicq</application> 需要 perl 5.6 以上的版本,
|
||||
因此需要先安裝 <filename role="package">lang/perl5</filename>,
|
||||
並且下 <command>use.perl port</command> 來啟用。</para></note>
|
||||
<para><application>oicq</application> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/oicq</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
<para>基本的使用:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>setenv OICQ_PW your_password_of_oicq</userinput>
|
||||
&prompt.root; <userinput>oicq your_id_of_oicq</userinput>
|
||||
&prompt.root; <userinput>/help</userinput></screen>
|
||||
<para>WWW: <ulink url="http://sourceforge.net/projects/perl-oicq/">
|
||||
Perl OICQ</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bluefish">
|
||||
<title>bluefish - 網頁編寫</title>
|
||||
<para>以標籤來編寫網頁,雖然不似微軟的 Front Page
|
||||
所見即所得般方便,且在編寫網頁之前,需對所有的標籤有所認識,
|
||||
卻可以完全的掌控整的網頁,讓您的網頁能擁有最精簡的內容,
|
||||
一點都沒有多餘的程式。 </para>
|
||||
<para>隨著時代的進步,除了 Html 之外,還有 PHP、XML、SSI、WML
|
||||
等等的出現。在 BlueFish 中,也完整的呈現出來,配合著標籤、
|
||||
精靈等等的引導,讓您達到您想要的網頁。尤其是對於
|
||||
PHP3、SSI、XML 更提供了相關的函式可供索引,讓您在編寫過程中,
|
||||
能更容易的使用。連最近相當熱門的 WAP 手機用的 WML 網頁格式,在
|
||||
BlueFish 中也有提供對應的功能。 </para>
|
||||
<para>這個網頁編寫軟體,是建構在 GTK 上的,所以在安裝本軟體之前,
|
||||
需有 GTK+1.2 以上的版本。 </para>
|
||||
<para>安裝 <filename role="package">www/bluefish</filename>。</para>
|
||||
<para>設定檔的部分也要修改一下,改 $HOME/.bluefish/rcfile 中的
|
||||
editor_font 和 fontset。</para>
|
||||
<programlisting>
|
||||
editor_font: 8x16,-*-16-*-big5-0
|
||||
fontset: 1</programlisting>
|
||||
<figure>
|
||||
<title>bluefish snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/bluefish" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://bluefish.openoffice.nl/">
|
||||
http://bluefish.openoffice.nl/</ulink>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tin">
|
||||
<title>tin - 新聞討論群閱讀器</title>
|
||||
<para>新聞群組(Newsgroups)是架設在 News server 上的一個討論園地,
|
||||
它分為很多版,每個人可以閱讀版上別人所刊登的討論信件,
|
||||
也可以自己刊登自己的討論信件,或回覆別人的討論信件。 </para>
|
||||
<para>安裝 <filename role="package">chinese/tin</filename>。</para>
|
||||
<para><application>tin</application> 是一個已將所有訊息中文化的
|
||||
新聞討論群閱讀器(news reader)。
|
||||
執行 <application>tin</application> 前必須先設定環境變數
|
||||
$NNTPSERVER 指向您想使用的新聞伺服器: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>setenv NNTPSERVER news.tw.freebsd.org</userinput> </screen>
|
||||
<para>並設定 alias,
|
||||
<command>alias tin 'env LC_CTYPE=en_US.ISO_8859-1 tin'</command>。 </para>
|
||||
<para>然後執行 <command>tin -r</command> 即可。</para>
|
||||
<para>在 news.freebsd.tw.org 中有所有 FreeBSD 的 mailing list,
|
||||
只要用 <command>y</command> 就可以列出所有的 mailing list,
|
||||
然後用 <command>s</command> 來訂閱。</para>
|
||||
<figure>
|
||||
<title>tin snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/tin" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.tin.org/">
|
||||
http://www.tin.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tintin">
|
||||
<title>tintin++ - MUD 工具</title>
|
||||
<para><application>TinTin++</application> 並非中文軟體。
|
||||
它只是在您玩中文 mud 時非常的有用。 </para>
|
||||
<para>安裝 <filename role="package">chinese/tintin++</filename>。</para>
|
||||
<para>下面是一些中文 mud 站:</para>
|
||||
<programlisting>
|
||||
FengYun fengyun.com 5555
|
||||
Xi You Ji 129.105.79.24 6905
|
||||
Xia ke Xing 207.76.64.2 5555 </programlisting>
|
||||
<para>以 <command>tt++</command> 來啟動,進去後可以用
|
||||
<command>#help</command> 來獲得一些指令,然後用
|
||||
<command>#help command</command> 可以知道更多的使用方式。
|
||||
然後用 <command>#end</command> 來離開。</para>
|
||||
<figure>
|
||||
<title>tintin++ snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/tintin++" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://mail.newclear.net/tintin/index.html">
|
||||
http://mail.newclear.net/tintin/index.html</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="xchat">
|
||||
<title>xchat</title>
|
||||
<para>IRC 可說是找志趣相投的人聊天的最好地方,可是為了讓聊天更有趣,
|
||||
IRC 的指令也十分之多,這時使用一個聊天軟體是比較方便的。</para>
|
||||
<para>目前台灣 BSD 族群聚會的 IRC 通常都在 irc.seed.net.tw 與
|
||||
irc.hinet.net 的 #bsdchat CHANNEL 中,由於之前
|
||||
irc.hinet.net 不穩,目前大家都呆在 irc.seed.net.tw 中。</para>
|
||||
<para>而 <application>XChat</application> 就是其中一個不錯的選擇,
|
||||
它的狀態選單十分之多,是它的的一項特色,像是您個人狀態、
|
||||
個人狀態用選單、各種狀態視窗,當然最基本的 IRC Channel
|
||||
的列表視窗也有,而且還可以設定 Channel 人數的下限,
|
||||
這樣就可以濾掉一些人數太少的Channel、斷線重連注意名單。</para>
|
||||
<para>另外,<application>XChat</application> 熱鍵也作的十分不錯,
|
||||
<command>F1~F10</command> 每個鍵都可以定義為熱鍵,
|
||||
而在視窗右邊也有熱鍵,
|
||||
而它們也都可以重新定義,而您可以只用視窗的上方工具列,
|
||||
更改您自身的全部狀態,如果您是Op(管理者),
|
||||
那麼在工具列上就可以更改聊天的主題了,讓您聊天幾乎都不需要打指令.</para>
|
||||
<para>安裝 <filename role="package">irc/xchat</filename>。</para>
|
||||
<para>安裝完 <application>xchat</application>
|
||||
後,主畫面的地方還不是中文的,只需要改一下設定就可以了。</para>
|
||||
<procedure>
|
||||
<step><para>設定(S)</para></step>
|
||||
<step><para>Setup</para></step>
|
||||
<step><para>Channel Windows</para></step>
|
||||
<step><para>Use gdk_fontset_load 打勾</para></step>
|
||||
<step><para>Font: 的部份選用 fixed(kc)</para></step>
|
||||
</procedure>
|
||||
<procedure>
|
||||
<step><para>設定(S)</para></step>
|
||||
<step><para>Setup</para></step>
|
||||
<step><para>Dialog Windows</para></step>
|
||||
<step><para>Use gdk_fontset_load 打勾</para></step>
|
||||
<step><para>Font: 的部份選用 fixed(kc)</para></step>
|
||||
</procedure>
|
||||
<para>
|
||||
,並關掉 <application>xchat</application> 重開。或是在
|
||||
<filename>.xchat/xchat.conf</filename> 中修改</para>
|
||||
<programlisting>
|
||||
use_fontset = 1
|
||||
font_dialog_normal = 8x16,kc15f,-*-16-*-big5-0
|
||||
font_normal = 8x16,kc15f,-*-16-*-big5-0</programlisting>
|
||||
<figure>
|
||||
<title>xchat snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/xchat" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://xchat.org/">http://xchat.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="irssi">
|
||||
<title>irssi</title>
|
||||
<para>安裝 <filename role="package">chinese/irssi</filename>。</para>
|
||||
<para>如果是使用 telnet 連線軟體而要有彩色 <application>irrsi
|
||||
</application>,則必須先設定 <command>setenv TERM xterm-color
|
||||
</command>。</para>
|
||||
<para>使用方法:<command>irssi -c irc.seed.net.tw -n your_nickname</command>
|
||||
,連上去之後,<command>/join #bsdchat</command>。</para>
|
||||
<para>WWW: <ulink url="http://www.irssi.org/">
|
||||
http://www.irssi.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bitchx">
|
||||
<title>bitchx</title>
|
||||
<para>一套中文字游標移動的 IRC 軟體。</para>
|
||||
<para>安裝 <filename role="package">chinese/bitchx</filename>。</para>
|
||||
<para>使用方法: <command>BitchX -n your_nickname irc.seed.net.tw
|
||||
</command>,會自動連上 irc.seed.net.tw。
|
||||
然後直接打 <command>/join #bsdchat</command> 就可以。</para>
|
||||
<para>WWW: <ulink url="http://www.bitchx.com/">
|
||||
http://www.bitchx.com/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mldonkey">
|
||||
<title>mldonkey - P2P</title>
|
||||
<para>mldonkey 是一套免費的 e-Donkey 用戶端。
|
||||
不過在文字介面的搜尋有點簡陋,筆者通常都是利用網頁介面來存取,
|
||||
也有 GTK 圖形介面。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/net/mldonkey</userinput>
|
||||
&prompt.root; <userinput>make WITHOUT_TK=yes WITHOUT_X11=yes install clean</userinput></screen>
|
||||
<para>然後最好自己選個共同的地方放,像是建立一個新使用者 mldonkey,
|
||||
然後將檔案都由該使用者來執行。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mkdir -p /home/mldonkey</userinput>
|
||||
&prompt.root; <userinput>cd /home/mldonkey</userinput></screen>
|
||||
<para>第一次執行會產生一些設定檔,接著先暫停執行,
|
||||
修改一些設定檔後,利用遠端網頁來控制。
|
||||
</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>mlnet-real &</userinput>
|
||||
&prompt.user; <userinput>sh /usr/local/bin/kill_mldonkey</userinput>
|
||||
&prompt.user; <userinput>vi servers.ini</userinput>
|
||||
known_servers = [
|
||||
{ server_network = Donkey
|
||||
server_age = 59138548
|
||||
server_addr = ("140.123.108.139", 7654)
|
||||
server_desc = "TLF Taiwan ED Server"
|
||||
server_name = "TLF Taiwan ED Server"
|
||||
};]
|
||||
&prompt.user; <userinput>vi downloads.ini</userinput>
|
||||
allowed_ips = [
|
||||
"127.0.0.1";
|
||||
"203.204.8.177";]
|
||||
&prompt.user; <userinput>mlnet-real &</userinput></screen>
|
||||
<para>然後就可以開啟遠端 http://127.0.0.1:4080/ 來抓檔案囉。</para>
|
||||
<para>如果要使用中文搜尋,則先在搜尋介面先按右鍵,
|
||||
<option>編碼 -> 繁體中文</option>,
|
||||
然後再輸入你要搜尋的中文名稱即可。
|
||||
或是安裝 <filename>outta-port/mldonkey</filename>,
|
||||
也可以直接把 <filename>outta-port/mldonkey/files</filename>
|
||||
底下的檔案複製到 <filename>net/mldonkey/files</filename> 底下。
|
||||
因為 <application>mldonkey</application> 直接在 http header 中設定了
|
||||
<option>charset=iso-8859-1</option>,
|
||||
因此最好的做法是希望作者提供其他編碼的選項,
|
||||
不然只能 patch source 了。</para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
<!-- $FreeBSD$ -->
|
||||
<chapter>
|
||||
<title></title>
|
||||
<sect1 id="">
|
||||
<title></title>
|
||||
<para><filename></filename>
|
||||
<application></application>
|
||||
<username></username>
|
||||
<option>Æ«üÈÊÕ</option>
|
||||
<literal></literal>
|
||||
<emphasis></emphasis>
|
||||
<quote></quote>
|
||||
<varname></varname>
|
||||
<devicename></devicename>
|
||||
<acronym></acronym>
|
||||
&man.man.1;
|
||||
</para>
|
||||
<screen>&promot.root; <userinput><replaceable></replaceable></screen>
|
||||
<programlisting><co id=""></programlisting>
|
||||
<calloutlist>
|
||||
<callout arearefs="">
|
||||
</callout>
|
||||
</calloutlist>
|
||||
<literallayout class="monospaced"></literallayout>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<sect2 id="">
|
||||
<title></title>
|
||||
</sect2>
|
||||
<example>
|
||||
<title></title>
|
||||
</example>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
|
@ -1,247 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.34
|
||||
-->
|
||||
|
||||
<chapter id="other">
|
||||
<title>其它軟體的中文相關問題</title>
|
||||
|
||||
<sect1 id="sendmail">
|
||||
<title>sendmail</title>
|
||||
<para>
|
||||
因為 <application>sendmail-8.8.x</application> 預設會將所有
|
||||
8-bit 的信件編碼後再送出,這或多或少會對收信人造成一些影響
|
||||
(參見 <link linkend="procmail">procmail</link> 的解決方法)。
|
||||
現在大部份的主機都已能直接傳送 8-bit 的信件,所以您最好重新編譯
|
||||
<application>sendmail</application>,將編碼功能關掉。 </para>
|
||||
<para>
|
||||
在下面地點(或映射站台)取回最新版本的
|
||||
<application>sendmail</application>: </para>
|
||||
<para>
|
||||
<ulink url="ftp://ftp.sendmail.org/ucb/src/sendmail/">
|
||||
ftp://ftp.sendmail.org/ucb/src/sendmail/</ulink> </para>
|
||||
<para>
|
||||
解開並更改 <filename>Makefile</filename>: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>tar zxvf sendmail-8.8.8.tar.gz</userinput>
|
||||
&prompt.root; <userinput>cd src/Makefiles</userinput>
|
||||
&prompt.root; <userinput>chmod u+w Makefile.FreeBSD</userinput>
|
||||
&prompt.root; <userinput>vi Makefile.FreeBSD</userinput> </screen>
|
||||
<para>
|
||||
在 <option>CFLAGS+=</option> 後加上
|
||||
<option>-DMIME8TO7=0</option>。編譯並安裝
|
||||
<application>sendmail</application>: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd ..</userinput>
|
||||
&prompt.root; <userinput>./makesendmail all install</userinput> </screen>
|
||||
<para>
|
||||
用手動方式安將 man pages 安裝到適當目錄(不裝也沒關係)。 </para>
|
||||
<para>
|
||||
砍掉舊的 <application>sendmail</application> 行程: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>kill -9 `head -1 /var/run/sendmail.pid`</userinput> </screen>
|
||||
<para>
|
||||
重新啟動 <application>sendmail</application>: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>/usr/sbin/sendmail -bd -q1h</userinput> </screen>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.sendmail.org/">
|
||||
http://www.sendmail.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="procmail">
|
||||
<title>procmail</title>
|
||||
<para>
|
||||
<application>procmail</application> 是一個電子郵件過濾器
|
||||
(mail filter)。它可
|
||||
將到的信件在存入您的信箱前先做處理,例如將信件分類等。不過這
|
||||
裡要教您的是如何利用
|
||||
<application>procmail</application> 來將被編碼的中文信
|
||||
件解碼成純文字,以及在不同編碼的信件轉換為您常用的編碼。 </para>
|
||||
<para>
|
||||
在您的 home 目錄下建立 <filename>.procmailrc</filename>
|
||||
檔案,內容如下: </para>
|
||||
<programlisting>
|
||||
# 在用 procmail 處理前先將信件儲存下來,以免發生意外
|
||||
# 您可以設定那些信件不必備份,例如由 MAILER-DAEMON 來的退信
|
||||
:0 c
|
||||
* !^From.*MAILER-DAEMON
|
||||
mail/procmail-backup
|
||||
|
||||
# 將以 quoted-printable 或 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"
|
||||
}
|
||||
|
||||
# 這裡判斷信件是否為 GB 編碼,若是則轉為 BIG5 編碼
|
||||
# 如果您要由 BIG5 轉為 GB 碼,要將例子中所有的 big5
|
||||
# 及 gb2312 互換,並將 hc -m b2g 改為 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"
|
||||
}
|
||||
|
||||
# 將信件存回信箱
|
||||
:0:
|
||||
${ORGMAIL} </programlisting>
|
||||
<para>
|
||||
這個例子中,配合了 mimencode,formail
|
||||
將信件解碼,並用
|
||||
<link linkend="hc">hc</link>
|
||||
將 GB 編碼的信件轉為 BIG5 編碼。所以您還必須安裝這些工具。 </para>
|
||||
<para>
|
||||
最後再將更改您的 <filename>.forward</filename> 檔就可以了 </para>
|
||||
<programlisting>
|
||||
"|IFS=' ' && exec /usr/bin/procmail -f- ~/.procmailrc ||exit 75 name" </programlisting>
|
||||
<para>
|
||||
注意:其中最後的 name 要改為您自己的簽入名稱(login name)。 </para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.procmail.org/">
|
||||
http://www.procmail.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="vim">
|
||||
<title>vim - VI 的進階編輯器</title>
|
||||
<para>
|
||||
它包括了一些和 <application>vi</application> 很像但
|
||||
<application>celvis-1.3</application> 所沒有的特色,像是行號,
|
||||
回繞行,及大型檔最主要的是可以輸入中文。 </para>
|
||||
<para>安裝 <filename role="package">editors/vim</filename>。</para>
|
||||
<para>
|
||||
我知道有人很討厭 <application>vim</application>,因為還要裝 X。
|
||||
其實只要用 <command>make -DWITHOUT_X11 install</command>
|
||||
就可以了只安裝文字版的 <application>vim</application>。 </para>
|
||||
<para>
|
||||
安裝 <application>ports/editors/vim</application> 後,
|
||||
根據個人喜好設定 <filename>.vimrc</filename>: </para>
|
||||
<programlisting>
|
||||
set fileencoding=taiwan
|
||||
set guifontset=8x16,kc15f,-*-16-*-big5-0</programlisting>
|
||||
<para>
|
||||
並且設定 zh_TW.Big5 的 locale,這樣子就可以一次刪除一個中文字。</para>
|
||||
<para>以下是建議的設定</para>
|
||||
<programlisting>
|
||||
set cindent
|
||||
set enc=taiwan
|
||||
set fileencoding=taiwan
|
||||
set hls
|
||||
set nocompatible
|
||||
set sw=2
|
||||
syntax on
|
||||
highlight Comment ctermfg=darkcyan
|
||||
highlight Search term=reverse ctermbg=4 ctermfg=7</programlisting>
|
||||
<para>
|
||||
在啟動的時候建議使用 <command>env TERM=xterm-color vim</command>
|
||||
,這樣漂亮的顏色才會出來 :)</para>
|
||||
<para>
|
||||
如果覺得字色太暗,可以用 <command>:set background=dark</command>。</para>
|
||||
<figure>
|
||||
<title>vim snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/vim" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.vim.org/">
|
||||
http://www.vim.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mailman">
|
||||
<title>mailman - How to Enable Chinese in Mailman2.1.1</title>
|
||||
<para>Last Update: 2003年 3月10日 周一 10時03分59秒 CST</para>
|
||||
<para>Contributed by: "Y. Cheng" <ycheng@slat.org></para>
|
||||
<para>今天終於有空來裝 mailman 2.1.1 啦 ^_^
|
||||
要 mailman 2.1.1 可已有繁體中文可以選, 需要以下額外動作:</para>
|
||||
<para>1. 安裝時加上參數 WITH_CHINESE=yes:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/mail/mailman</userinput>
|
||||
&prompt.root; <userinput>make WITH_CHINESE=yes install clean</userinput> </screen>
|
||||
<para>2. 把 $(prefix)/Mailman/Defaults.py 裡面的
|
||||
DEFAULT_SERVER_LANGUAGE = 'en' 改為
|
||||
DEFAULT_SERVER_LANGUAGE = 'big5':</para>
|
||||
<programlisting>
|
||||
--- Mailman/Defaults.py.in.orig Mon Mar 10 23:49:48 2003
|
||||
+++ Mailman/Defaults.py.in Mon Mar 10 23:50:02 2003
|
||||
@@ -670,7 +670,7 @@
|
||||
# The default language for this server. Whenever we can't figure out the list
|
||||
# context or user context, we'll fall back to using this language. See
|
||||
# LC_DESCRIPTIONS below for legal values.
|
||||
-DEFAULT_SERVER_LANGUAGE = 'en'
|
||||
+DEFAULT_SERVER_LANGUAGE = 'big5'
|
||||
|
||||
# When allowing only members to post to a mailing list, how is the sender of
|
||||
# the message determined? If this variable is set to 1, then first the</programlisting>
|
||||
<para>3. 把 $(prefix)/pythonlib/email/Charset.py 裡面的
|
||||
<option>'big5': 'big5_tw',</option> 改為
|
||||
<option>'big5': 'big5',</option>,否則
|
||||
subscribe mail list 時就會出現 bug.</para>
|
||||
<programlisting>
|
||||
--- pythonlib/email/Charset.py.orig Sun Oct 13 12:00:20 2002
|
||||
+++ pythonlib/email/Charset.py Tue Mar 11 10:19:07 2003
|
||||
@@ -70,7 +70,7 @@
|
||||
'iso-2022-jp': 'japanese.iso-2022-jp',
|
||||
'shift_jis': 'japanese.shift_jis',
|
||||
'gb2132': 'eucgb2312_cn',
|
||||
- 'big5': 'big5_tw',
|
||||
+ 'big5': 'big5',
|
||||
'utf-8': 'utf-8',
|
||||
# Hack: We don't want *any* conversion for stuff marked us-ascii, as all
|
||||
# sorts of garbage might be sent to us in the guise of 7-bit us-ascii.</programlisting>
|
||||
<para>初步測試這樣 ok, 會不會有進一步問題, 還需要多測試.</para>
|
||||
<para>ycheng</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="pvpgn">
|
||||
<title>pvpgn - Blizzard's Battle.net service</title>
|
||||
<para>國內最有名的 Battle.net 是豬頭C 的
|
||||
<ulink url="http://bnet.custom.idv.tw">魔獸3 台灣伺服器網站</ulink>,
|
||||
上面有非常詳細的介紹如何使用工具來連上非官方的伺服器。</para>
|
||||
<para>元智校內 Server: 140.138.145.35</para>
|
||||
<para>StarCraft 1.10、StarCraft Expansion Set 1.10、
|
||||
WarCraftIII 1.12、WarCraftIII The Frozen Throne 1.12、
|
||||
Diablo II LoD 1.09 Open Battle.Net、
|
||||
Diablo II LoD 1.09 Closed Battle.Net。</para>
|
||||
<para><application>pvpgn</application> 的安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/outta-port/pvpgn</userinput>
|
||||
&prompt.root; <userinput>make install clean</userinput></screen>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.12
|
||||
-->
|
||||
|
||||
<chapter id="outta">
|
||||
<title>發展中的中文軟體 Outta-port</title>
|
||||
<para>
|
||||
&a.ycheng; Date: 3 Jul 1999 10:07:20 GMT
|
||||
</para>
|
||||
<para>1. 什麼是 Outta-Port ?</para>
|
||||
<para>Outta-Port 是 port 以外的 port.</para>
|
||||
<para>也就是說,當我們在寫 port 時,我們認為該 port 還不是很穩定
|
||||
,還不想將之 commit 進 FreeBSD 總部的程式中,但是有希望一群
|
||||
人可以一起還維護這一組 port 時,我們就將之 commit 進 outta-port.</para>
|
||||
<para>2. 如何取得 Outta-Port ?</para>
|
||||
<para>cvsup ;)</para>
|
||||
<para>先假設您會用 cvsup 和 ports. 取得
|
||||
<ulink url="http://freebsd.sinica.edu.tw/conf/outta-port.supfile">
|
||||
outta-port.supfile</ulink> 這個 supfile 將 outta-port 目錄放在
|
||||
<filename>/usr/ports</filename> 下.
|
||||
假設您安裝好了 <command>cvsup</command>,請下指令
|
||||
<command>cvsup -g outta-port.supfile</command>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports</userinput>
|
||||
&prompt.root; <userinput>fetch http://freebsd.sinica.edu.tw/conf/outta-port.supfile</userinput>
|
||||
&prompt.root; <userinput>cvsup -g outta-port.supfile</userinput></screen>
|
||||
<para>或是直接編輯 outta-port.supfile,內容如下:</para>
|
||||
<programlisting>
|
||||
*default host=freebsd.sinica.edu.tw
|
||||
*default base=/usr/ports
|
||||
*default prefix=/usr/ports
|
||||
*default release=cvs
|
||||
*default delete use-rel-suffix
|
||||
|
||||
outta-port tag=.</programlisting>
|
||||
<para>3. 如何加入 Outta-Port maintainer ?</para>
|
||||
<para>把做好的 Port 寄份 email 到 statue@freebsd.sinica.edu.tw,
|
||||
最好是 shar 的格式。</para>
|
||||
<para>4. 如何知道最新消息</para>
|
||||
<para>寄份 email 到 majordomo@freebsd.sinica.edu.tw,內容為
|
||||
subscribe freebsd-taiwan-cvslog</para>
|
||||
<para>5. 現在 Outta-Port 中有甚麼?</para>
|
||||
<para>有很多奇怪的東西,不妨自己裝了看看。</para>
|
||||
|
||||
<sect1 id="xfig">
|
||||
<title>xfig</title>
|
||||
<para>
|
||||
XFIG 3.2.2 - Facility for Interactive Generation of figures
|
||||
under X11 This port now accepts input from XIM server, such
|
||||
as XCIN.
|
||||
</para>
|
||||
<para>在 /usr/X11R6/lib/X11/app-defaults/Fig 設定:</para>
|
||||
<programlisting>
|
||||
Fig.international: true
|
||||
Fig*edit_panel*Text_text*international: true
|
||||
Fig*edit_panel*inputMethod: xim </programlisting>
|
||||
<para><command>export LANG=zh_TW.Big5</command></para>
|
||||
<para>再來執行 xfig。注意,光 LC_CTYPE 設成 zh_TW.Big5 是不行的。</para>
|
||||
<para>如果不能用,表示您的 xfig 編譯時沒有加入 i18n 功能。
|
||||
或XMODIFIERS 環境變數沒有設好。</para>
|
||||
<note>
|
||||
<para>
|
||||
Because XCIN needs Alt keys, Alt/Meta are disabled. Use Esc
|
||||
as compose key instead.
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="movabletype">
|
||||
<title>MT - movabletype blog</title>
|
||||
<para>It is a decentralized, web-based personal publishing system designed to ease
|
||||
maintenance of regularly updated news or journal sites, like weblogs. </para>
|
||||
<para>安裝 <filename role="package">chinese/MT</filename>,
|
||||
他會一並安裝 <filename role="packahe">www/MT</filename>。</para>
|
||||
<para>WWW: <ulink url="http://www.movabletype.org/">
|
||||
http://www.movabletype.org/</ulink></para>
|
||||
<para>WWW: <ulink url="http://blog.elixus.org/">
|
||||
blogging elixus - 正體中文blog資訊中心</ulink></para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,256 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.19
|
||||
-->
|
||||
|
||||
<chapter id="preface">
|
||||
<title>前言</title>
|
||||
<para>Last Update: 2003年10月12日 周日 17時18分53秒 CST</para>
|
||||
<para>與其抱怨四周黑暗,不如點燃一根火柴照亮它。</para>
|
||||
<para>從筆者在大一時開始接觸 FreeBSD 到現在已經五年有餘,
|
||||
一開始除了李建達的黑皮書,以及 news:tw.bbs.comp.386bsd 的文章外,
|
||||
還有一群喜愛玩弄 FreeBSD 的朋友。
|
||||
從一開始幫忙維護風之塔 BBS 到後來專注於 FreeBSD 的中文化,
|
||||
不斷的從錯誤嘗試中獲得快樂,為每一個新的軟體而讚嘆,
|
||||
最重要的是總有一群跟你一樣在錯誤中摸索的人。
|
||||
與其抱怨文件不多,不如自己開始寫文件。
|
||||
雖然在網路上做過的蠢事不少,也不知道有多少人會認同這樣子的文件,
|
||||
總有這樣子的傻子會做下去,直到連自己都不認同了。</para>
|
||||
<para>還記得大一時在宿舍第一次把 X Window 安裝起來時,
|
||||
順利執行漂亮的 Enlightenment,那種興奮,會讓人想在宿舍把左鄰右舍都吵醒,
|
||||
還好沒有做,不然應該會被海扁一頓。</para>
|
||||
<para>FreeBSD 的環境的確不如 GNU/Linux 那樣的多人使用,
|
||||
現有的文件量也是明顯的少,商業炒作更是少見,
|
||||
或許把 FreeBSD 歸類為學術用作業系統,會讓人在使用上更為輕鬆。</para>
|
||||
<para>FreeBSD 的中文化,實際上筆者並沒有做過十分多的貢獻,
|
||||
只有把前人的做法做整理與測試,然後又自己簡陋的文筆,
|
||||
記憶下來當時的狀況。
|
||||
曾經想弄過 Chinese FreeBSD Extension(CFE),
|
||||
當初並沒有像很多細節,
|
||||
只是希望能有個像 Chinese Linux Extension(CLE) 一樣的討論環境,
|
||||
這大概是做過的重大蠢事之一,
|
||||
大部分的人都不贊成類似 CLE 的做法,
|
||||
後來為了避免與 CLE 繼續做比較,改名為 Chinese FreeBSD Collection(CFC),
|
||||
做了幾個版本後,發現維護版本的問題十分花時間,
|
||||
另一方面是這樣子一個人的專案終究活不久,
|
||||
慢慢的轉向寫文件來紀錄自己的測試結果,
|
||||
這樣子對自己比較輕鬆。</para>
|
||||
<para>中文化慢慢穩定,也慢慢被忽略。
|
||||
已經沒有那麼多迫切的中文問題的時候,也該是中文化該落幕劇終的時候。
|
||||
目前只要任選一套 FreeBSD 或是 GNU/Linux 都可以簡單的使用中文,
|
||||
當商業介入後,情況應該只會更好,畢竟有瑕疵的產品銷售量都不會太好。</para>
|
||||
|
||||
<sect1 id="intro">
|
||||
<title>簡介</title>
|
||||
<para>這份文件大部分都不是作者親自撰寫的,
|
||||
由網路上大家所努力出來的成果蒐集為主,
|
||||
雖然有想過要轉型成為 "FreeBSD 中文使用環境" 簡介文件,
|
||||
不過礙於作者本身的能力與時間的不足,所以還在慢慢規劃中。</para>
|
||||
<para>關於 FreeBSD 可以先參考它的官方網站
|
||||
<ulink url="http://www.freebsd.org">http://www.freebsd.org</ulink>
|
||||
,以及他所提供的豐富文件,目前較為建議的閱讀是
|
||||
<ulink url="http://freebsd.sinica.edu.tw/handbook/">
|
||||
FreeBSD Handbook</ulink>。</para>
|
||||
<para>本文目前適合給已經有安裝 FreeBSD 概念,但遇到中文相關問題時,
|
||||
可以用來找資料的文件,初學者可能要先閱讀過基本的文章後,
|
||||
例如 FreeBSD Handbook,也有 <ulink url="http://freebsd.sinica.edu.tw/handbook/ports.html">
|
||||
FreeBSD Ports Collection</ulink> 的使用概念後,會更為適合閱讀此份文件。
|
||||
在閱讀此份文件時,目前還沒辦法一步步的引導使用者去設立
|
||||
FreeBSD 中文使用環境,不過這將是我們未來的目標。</para>
|
||||
<para> 本文件雖已力求正確,然而無法保證所有操作/設定範例,
|
||||
都可以順利的在您的系統上面進行。
|
||||
如果您依照本文件的說明而使您的系統發生任何問題或損失,
|
||||
作者都將不負任何責任。</para>
|
||||
<para>
|
||||
希望由於本文的出現,能大量減少在網路上一再重複出現的問題:
|
||||
"為什麼我不能輸入/看到中文?" 等等。
|
||||
雖然我也了解這是不太可能的...</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="howtoget">
|
||||
<title>如何取得這份文件?</title>
|
||||
<para>這份文件目前可以在這個網址取得:</para>
|
||||
<para>
|
||||
WWW: <ulink url="http://freebsd.sinica.edu.tw/~statue/zh-tut.php">
|
||||
http://freebsd.sinica.edu.tw/~statue/zh-tut.php</ulink></para>
|
||||
<para>這份文件是由 SGML 所編寫而成的,如果想取得原始檔案,
|
||||
可以用以下的方式:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>cvs -d :pserver:anoncvs@freebsd.sinica.edu.tw:/home1/ncvs login</userinput>
|
||||
(Logging in to anoncvs@freebsd.sinica.edu.tw)
|
||||
CVS password: <userinput>anoncvs</userinput>
|
||||
&prompt.user; <userinput>cvs -d :pserver:anoncvs@freebsd.sinica.edu.tw:/home1/ncvs checkout zh-tut</userinput></screen>
|
||||
<para>如果想手動產生 HTML,TXT 等格式,則必須照以下的方式:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports/textproc/docproj</userinput>
|
||||
&prompt.root; <userinput>make JADETEX=yes install clean</userinput>
|
||||
&prompt.root; <userinput>cvsup -g /usr/share/examples/cvsup/doc-supfile</userinput> </screen>
|
||||
<para>
|
||||
接著修改 <filename>/usr/local/share/texmf/web2c/texmf.cnf</filename>,
|
||||
將以下改成 hash_extra = 25000,max_strings = 150000,
|
||||
pool_free = 50000,這樣應該就可以了。</para>
|
||||
<para>接著就可以到 <filename>zh-tut/</filename> 底下用
|
||||
<command>make FORMATS=html</command> 製作整頁模式的 HTML 版本,
|
||||
<command>make FORMATS=split-html</command> 製作章節模式的 HTML 版本,
|
||||
因為以 <command>make FORMATS=pdf</command> 製作出來的 PDF
|
||||
中文無法正常顯示,<command>make FORMATS=ps</command> 製作出來的 PS
|
||||
版本也是如此,所以目前的 PDF 版本是用 Adobe Distiller
|
||||
以預設值 PDF 1.3 做出非內嵌中文的 PDF 版本,以及以 PDF 1.2 ,
|
||||
並內嵌字型製做出內嵌中文的 PDF 版本。
|
||||
並用 WebCapture2CK 增效模組做出了 PDF 的有超連結版本。
|
||||
TXT 版本則是使用
|
||||
<application>lynx</application> 的 <option>-dump</option>
|
||||
並搭配 <option>-assume_charset=big5 -assume_local_charset=big5</option>
|
||||
瀏覽整頁模式 HTML 版本所製作出來的。
|
||||
PS 的版本則是由 <command>pdf2ps</command> 所製作,
|
||||
不過做出來會變成 30 MB,不太適合下載。</para>
|
||||
<sect2 id="jadetex">
|
||||
<title>jadetex - SGML+JadeTex 產生不內嵌字型的中文 PDF</title>
|
||||
<para>Contributed by 海邊的野孩子 (edwar.bbs@bbs.sayya.org)</para>
|
||||
<para>Last Update: 2003年 4月 7日 周一 19時11分14秒 CST</para>
|
||||
<para>在產生中文 HTML 的部分沒什麼問題,只要在 freebsd.dsl 的
|
||||
style-specification-body 的標籤內,加上如下的宣告即可:</para>
|
||||
<programlisting>
|
||||
(define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=Big5"))))</programlisting>
|
||||
<para>但是要產生 PDF 則要先安裝 <application>teTeX</application>,
|
||||
<application>docproj</application>,
|
||||
<application>CJK</application>,
|
||||
<application>xpdf</application> 等應用軟體,請參考前一節的說明。</para>
|
||||
<para>jade 可以將 XML/SGML 轉換成 tex 檔,若是 XML 原本內含中文,
|
||||
或是其他 CJK 文字,原本會輸出成一般的中文,
|
||||
加上環境變數 SP_ENCODING=Big5 後,
|
||||
輸出的 tex 檔會將這些文字用 \Character{29992}
|
||||
表示,這數字是 unicode,「&#29992;」在 unicode 裡是中文的「用」字。
|
||||
</para>
|
||||
<para>若是直接以 jadetex 編譯這個 .tex,會出現 Unknown character
|
||||
的錯誤訊息,我的方式很簡單,既然這些字元沒有定義,就幫他定義一下,
|
||||
在編譯的時候先引入就好了。</para>
|
||||
<para>定義一個 cjk-char.sty,每行的內容像:</para>
|
||||
<programlisting>
|
||||
\DefineCharacter{19968}{4E00}{\begin{CJK*}{Bg5}{bsmi}XXX\end{CJK*}}</programlisting>
|
||||
<para>XXX 是經過 bg5conv 處理過的中文字。因為每個字都用 \begin{CJK*}
|
||||
和 \end{CJK*} 包住,所以編譯時會很久。
|
||||
這個做法可能可以在一份文件中用到好幾種編碼的文字。</para>
|
||||
<para>若要加快編譯速度,就要將 \begin{CJK*} 用在開頭,
|
||||
\end{CJK*} 放在 \endFOT{} 之前。這樣可以大幅提昇速度,
|
||||
但是一份文件裡可能就只能有一種編碼的亞洲文字。
|
||||
還有一種做法是最開始使用 \begin{CJK*}{}{bsmi},
|
||||
在每個字定義的地方都用 \CJKenc{Bg5} 來指定編碼,
|
||||
這樣速度會比第一種快一些。</para>
|
||||
<para>然後在 .tex 的開頭加入
|
||||
<option>\usepackage{CJK,pslatex}\input cjk-char.sty</option>
|
||||
再進行編譯。下面就是我的步驟,cjk-char.sty 要自行下載。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>env SP_ENCODING=Big5 make FORMATS=tex</userinput>
|
||||
&prompt.root; <userinput>echo '\usepackage{CJK,pslatex}\input cjk-char.sty' > zh-tut.tex.2</userinput>
|
||||
&prompt.root; <userinput>cat zh-tut.tex >> zh-tut.tex.2</userinput>
|
||||
&prompt.root; <userinput>mv zh-tut.tex.2 zh-tut.tex</userinput>
|
||||
&prompt.root; <userinput>env SP_ENCODING=Big5 make FORMATS=dvi</userinput>
|
||||
&prompt.root; <userinput>dvipdfmx zh-tut.dvi</userinput></screen>
|
||||
<para>最後用 <application>xpdf</application> 的
|
||||
<command>pdffont</command> 檢驗。
|
||||
在 type 的地方全都是 <option>Type 1</option> 就沒問題囉。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pdffonts zh-tut.pdf</userinput>
|
||||
name type emb sub uni object ID
|
||||
------------------------------------ ------------ --- --- --- ---------
|
||||
Helvetica-Bold Type 1 no no no 8 0
|
||||
Times-Roman Type 1 no no no 15 0
|
||||
ShanHeiSun-Light CID TrueType no no no 18 0
|
||||
Courier Type 1 no no no 19 0
|
||||
Helvetica Type 1 no no no 20 0
|
||||
Times-Bold Type 1 no no no 25 0
|
||||
Times-Italic Type 1 no no no 26 0
|
||||
Courier-Bold Type 1 no no no 59 0
|
||||
UJULYZ+CMMI10 Type 1 yes yes no 167 0</screen>
|
||||
<para>DL: <ulink url="http://freebsd.sinica.edu.tw/zh-tut/cjk-char.sty">
|
||||
cjk-char.sty</ulink></para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="warning">
|
||||
<title>注意事項</title>
|
||||
<para>
|
||||
本文中範例的使用以 <application>csh</application>/
|
||||
<application>tcsh</application> 為主。若您使用的是
|
||||
<application>sh</application>/<application>bash</application>
|
||||
,請注意其中的差異。例如對環境變數的設定,在
|
||||
<application>sh</application>/<application>bash</application>
|
||||
中是 </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>export TERM=vt100</userinput> </screen>
|
||||
<para>在 <application>csh</application>/
|
||||
<application>tcsh</application> 中則是</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>setenv TERM vt100</userinput> </screen>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="aim">
|
||||
<title>目標</title>
|
||||
<para>
|
||||
本文希望能提供在 FreeBSD 系統上使用中文的完整而自足的說明。
|
||||
只要是與 FreeBSD 上使用中文有關的,我都希望能夠包括進來!然而,
|
||||
限於個人智識與能力,我知道這幾乎是個"不可能的任務"。
|
||||
因此,有任何的不足或遺漏之處,請別在意,儘量告訴我!</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="learn">
|
||||
<title>如何學 BSD?</title>
|
||||
<para>目前網路文件已經有幾本觀念還算完整的書,
|
||||
我會建議先閱讀 <ulink url="http://freebsd.sinica.edu.tw/docs/cfreebsd/">
|
||||
FreeBSD 使用手冊</ulink> 和 <ulink url="http://freebsd.sinica.edu.tw/docs/csh">
|
||||
網路農夫</ulink> 來獲得一些基本的觀念,<ulink url="http://info.sayya.org/~edt1023/linux_entry.html">
|
||||
GNU/Linux 初探</ulink> 也是十分值得參考的文件之一,
|
||||
有了基本的觀念後,就可以進階的閱讀
|
||||
<ulink url="http://www.study-area.org/2freebsd/2freebsd.htm">
|
||||
FreeBSD 入魔手冊</ulink> 以及
|
||||
<ulink url="http://freebsd.sinica.edu.tw/docs/completed/">
|
||||
王波的 FreeBSD 大全</ulink> ,
|
||||
<ulink url="http://freebsd.sinica.edu.tw/handbook.php">
|
||||
繁體 FreeBSD handbook</ulink>。
|
||||
從這些文件中,就可以含蓋從安裝到使用的觀念與用法,
|
||||
對一個入門 BSD 的人應該是十分足夠的了。
|
||||
如果對任何中文的相關議題有興趣可以參考拙作的
|
||||
<ulink url="http://freebsd.sinica.edu.tw/zh-tut.php">
|
||||
FreeBSD Chinese HOWTO</ulink>。
|
||||
</para>
|
||||
<para>
|
||||
好的文件 (manpage 也算) 大多數都是原文的,需要時間慢慢看,
|
||||
但是資料也最豐富、完整。</para>
|
||||
<para>
|
||||
如果想要找中文的文件,您可以用 Google 找看看有沒有寫出中文的
|
||||
documents:<ulink url="http://www.google.com/">
|
||||
http://www.google.com</ulink>。</para>
|
||||
<para>
|
||||
用 Google 的時候善用 site: 這個指令,有時候您只想找中文的資料,
|
||||
但是您的 keyword 只有英文,這時候您可以加 site:tw 讓它只找
|
||||
*.tw 的 site。</para>
|
||||
<para>
|
||||
平常想要找軟體,我們會到 <filename>/usr/ports</filename> 底下用
|
||||
<command>make search key=keyword</command> 找。</para>
|
||||
<para>
|
||||
通常 pkg-descr 會有 Website url,如果 ports 的軟體不會用,
|
||||
可以去原來的 site 翻翻看 mailing list。再不行到 Google 再找。</para>
|
||||
<para>
|
||||
handbook 對於基本操作及設定會有很大的幫助,不過我不認為原文的
|
||||
handbook 對初學者而言是一個好的開始,
|
||||
可以看看已經部份翻譯好的版本。</para>
|
||||
<para>
|
||||
WWW: <ulink url="http://info.sayya.org/~edt1023/linux_entry.html">
|
||||
http://info.sayya.org/~edt1023/linux_entry.html</ulink></para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
|
@ -1,730 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.54
|
||||
-->
|
||||
|
||||
<chapter id="print">
|
||||
<title>中文的列印</title>
|
||||
<para>PostScript 是印表機控制語言的標準,GhostScript 是 PostScript 解譯器,
|
||||
可以用來模擬實際的印表機支援。所以選購印表機時,
|
||||
必須選擇印表機支援 PostScript 的,至少是 GhostScript 所支援的印表機。
|
||||
<ulink url="http://www.cs.wisc.edu/~ghost/">GhostScript 的首頁</ulink>
|
||||
中有支援的印表機清單,<ulink url="http://www.linuxprinting.org/">
|
||||
LinuxPrinting.org</ulink> 也有許多關於印表機支援的狀況。</para>
|
||||
<para>但是如果您的印表機只支援 Windows 或是 MacOS,那麼請用
|
||||
<application>ps2pdf12</application>/
|
||||
<application>ps2pdf13</application> 將下面各方式做出的
|
||||
<filename>output.ps</filename>
|
||||
轉成 <filename>pdf</filename> 檔案到 windows 下去列印。只要打:
|
||||
<command>ps2pdf1x output.ps output.pdf</command>
|
||||
即可。(其實若是有此情況,
|
||||
我們建議您直接將原本需要列印的檔案直接傳至印表機所在的機器列印即可)</para>
|
||||
<para>對本機印表機而言,支援 PostScript 的印表機只要將 PostScript
|
||||
檔送給列印裝置即可完成列印。
|
||||
不支援 PostScript 的印表機就要尋求 GhostScript 支援,
|
||||
利用 GhostScript 將 PostScript 檔送給列印裝置才能完成列印,
|
||||
也常用於不內嵌字型的檔案列印。
|
||||
對網路印表機的話,仍然分為上面兩種。
|
||||
以下以一個網路印表機 HP LasetJet 6P,
|
||||
不支援 PostScript 但是有 GhostScript 支援的為例:</para>
|
||||
<para>經過 linuxprinting 的查詢,得知有
|
||||
<filename role="package">print/hpijs</filename> 的支援。</para>
|
||||
<para>在產生要列印的 PostScript 檔後,利用 gs 來產生 PCL 檔:</para>
|
||||
<programlisting>
|
||||
gs -sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD \
|
||||
-sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="HP LaserJet" \
|
||||
-sOutputFile="output.pcl" input.ps</programlisting>
|
||||
<para>先利用 smbclient 得到 Printer 名稱:</para>
|
||||
<programlisting>
|
||||
&prompt.user; <userinput>smbclient -L host.ip -U username</userinput>
|
||||
Sharename Type Comment
|
||||
--------- ---- -------
|
||||
HPLaserJ Printer HP LaserJet 6P</programlisting>
|
||||
<para>然後直接用 smbclient 來列印即可:</para>
|
||||
<programlisting>
|
||||
&prompt.user; <userinput>smbclient //host.ip//HPLaserJ -U username</userinput>
|
||||
print output.pcl</programlisting>
|
||||
<para>最後是將該網路印表機當成本機印表機,修改 <filename>/etc/printcap</filename>:</para>
|
||||
<programlisting>
|
||||
lp-remote:\
|
||||
:lp=/dev/null:\
|
||||
:mx=0:\
|
||||
:if=/usr/local/bin/smbprint:
|
||||
lp:\
|
||||
:lp=/dev/null:\
|
||||
:sd=/var/spool/lpd/lp:\
|
||||
:af=/var/spool/lpd/lp/acct:\
|
||||
:if=/usr/local/bin/smbfilter:</programlisting>
|
||||
<para>並編寫 <filename>/usr/local/bin/smbprint</filename>:</para>
|
||||
<programlisting>
|
||||
#!/bin/sh -x
|
||||
logfile=/tmp/smbprint.log
|
||||
server=host.ip
|
||||
service=HPLaserJ
|
||||
username=username
|
||||
password=
|
||||
|
||||
echo "server $server, service $service, username $username" >> $logfile
|
||||
(
|
||||
echo "print -"
|
||||
cat
|
||||
) | /usr/local/bin/smbclient "\\\\$server\\$service" $password -U $username -N -P >> $logfile</programlisting>
|
||||
<para>以及 <filename>/usr/local/bin/smbfilter</filename>:</para>
|
||||
<programlisting>
|
||||
#!/bin/sh
|
||||
gs -dSAFER -dBATCH -dNOPAUSE -q \
|
||||
-sDEVICE=ijs -sIjsServer=hpijs -dIjsUseOutputFD \
|
||||
-sDeviceManufacturer="HEWLETT-PACKARD" -sDeviceModel="HP LaserJet" \
|
||||
-sOutputFile=- - | \
|
||||
lpr -Plp-remote</programlisting>
|
||||
<programlisting>
|
||||
&prompt.root; <userinput>mkdir -p /var/spool/lpd/lp</userinput>
|
||||
&prompt.root; <userinput>setenv PRINTER lp</userinput></programlisting>
|
||||
|
||||
<para>以下是一個小 script,幫您自動將純文字檔分頁</para>
|
||||
<programlisting>
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# This tiny script converts ^L to empty lines
|
||||
# to fit a2ps
|
||||
# Currently it only eats from STDIN and output to STDOUT.
|
||||
# Fine enough.
|
||||
# Customize the $expbl (Expected blank lines) to meet your
|
||||
needs.
|
||||
my $expbl=40; # Customize THIS !!!
|
||||
meow
|
||||
my $lc=0, $restlc=0 ;
|
||||
foreach (<>) {
|
||||
if (/^L/) {
|
||||
$restlc = $expbl - (($lc % $expbl)) ;
|
||||
for ($i=1; $i < $restlc; $i++) {
|
||||
$lc++ ;
|
||||
# print "$lc " . "\n" ;
|
||||
# You could comment out above line to see the
|
||||
line number.
|
||||
print "\n" ;
|
||||
}
|
||||
}
|
||||
s/^L// ;
|
||||
if (/\n/) { $lc++ ;}
|
||||
# print "$lc " .$_ ;
|
||||
# You could comment out above line to see the line
|
||||
number.
|
||||
print $_ ;
|
||||
}</programlisting>
|
||||
<para>WWW: <ulink url="http://www.softwareliberty.org.tw/project/software-map/v1.01/node111.html">
|
||||
自由軟體簡介 - 中文輸出</ulink></para>
|
||||
<para>WWW: <ulink url="http://www.twics.com/~craig/writings/linux-nihongo/node68.html">
|
||||
Japanese Printing and Text Processing With Linux</ulink></para>
|
||||
|
||||
<sect1 id="now-printing">
|
||||
<title>現在的中文列印</title>
|
||||
<para>在看現在的中文列印前,請先參考過
|
||||
<link linkend="postscript">PostScript</link> 一節,
|
||||
簡單的來說 CID-Keyed font 創造出來,
|
||||
就是要解決 cjk 這些方塊字型的國家。</para>
|
||||
<para>
|
||||
目前的中文顯示已經算是完備,我們平常需求的粗體與斜體都能正常顯示,
|
||||
利用 -medium-r 對應普通字型,-bold-r 對應粗體,-medium-i 對應斜體,
|
||||
-bold-i 對應粗斜體。</para>
|
||||
<para>
|
||||
由於 <filename>print/ghostscript-gnu</filename> 從 6.53 升級到 7.05,
|
||||
相對應的
|
||||
<filename>chinese/ghostscript6</filename> 與
|
||||
<filename>print/ghostscript-gnu-cjk</filename>(gs-cjk) 也都 BROKEN,
|
||||
中文列印就成了一個問題,不過,原來 <application>gs-cjk</application>
|
||||
已經融入 7.05,
|
||||
而且增加的方式更是簡單,以下用 mozilla 的中文列印來說明
|
||||
只要修改 <filename>/usr/local/share/ghostscript/7.05/lib/CIDFnmap</filename>
|
||||
最後增加:</para>
|
||||
<programlisting>
|
||||
% Chinese Big5 Truetype Fonts (Arphic)
|
||||
/ZenKai-Medium (/usr/local/share/fonts/TrueType/bkai00mp.ttf) 1 ;
|
||||
/ShanHeiSun-Light (/usr/local/share/fonts/TrueType/bsmi00lp.ttf) 1 ;
|
||||
%
|
||||
% Convenient aliases for PS files on Chinese PostScript printer
|
||||
%
|
||||
/B5-H /ZenKai-Medium ;
|
||||
/ETen-B5-H /ZenKai-Medium ;
|
||||
/B5-H /ShanHeiSun-Light ;
|
||||
/ETen-B5-H /ShanHeiSun-Light ;
|
||||
%
|
||||
% CID fontmap for chinese-big5 encoding CIDFontName
|
||||
%
|
||||
/Adobe-CNS1 /ShanHeiSun-Light ;
|
||||
/MSung-Light /ShanHeiSun-Light ;
|
||||
/MHei-Medium /ZenKai-Medium ;
|
||||
/MOESung-Regular /ShanHeiSun-Light ;
|
||||
/MOEKai-Regular /ZenKai-Medium ;
|
||||
% Chinese GB TrueType Fonts (Arphic)
|
||||
/BousungEG-Light-GB (/usr/local/share/fonts/TrueType/gbsn00lp.ttf) 1 ;
|
||||
/GBZenKai-Medium (/usr/local/share/fonts/TrueType/gkai00mp.ttf) 1 ;
|
||||
%
|
||||
% CID fontmap for chinese-big5 encoding CIDFontName
|
||||
%
|
||||
/Adobe-GB1 /BousungEG-Light-GB ;
|
||||
/STSong-Light /BousungEG-Light-GB ; </programlisting>
|
||||
<para>要完成以下的動作,請先確認是否安裝
|
||||
<application>ghostscript-gnu</application>,並且版本大於 7.05,
|
||||
或是安裝 6.53 版本加上 <application>gscjk</application>,
|
||||
並且安裝好 <application>arphicttf</application>,也把
|
||||
<filename>CIDFnmap</filename> 設定成功,
|
||||
若要測試請參考
|
||||
<link linkend="test-cidfnmap">修改 CIDFnmap 的測試</link> 一節。</para>
|
||||
<para>WWW: <ulink url="http://www.gyve.org/gs-cjk/index-t.html">
|
||||
gs-cjk project</ulink></para>
|
||||
<para>WWW: <ulink url="http://zope.slat.org/Members/Keanu/slack_cprint/slack_cprint.stx/view">
|
||||
Slackware 8.1 上的中文列印</ulink></para>
|
||||
<sect2>
|
||||
<title>mozilla 僅有普通字體</title>
|
||||
<para>
|
||||
接著修改 /usr/X11R6/lib/mozilla/defaults/pref/unix.js 最後增加</para>
|
||||
<programlisting>
|
||||
pref("print.postscript.nativecode.zh-TW", "big5");
|
||||
pref("print.postscript.nativefont.zh-TW", "MSung-Light-B5-H");</programlisting>
|
||||
<para>
|
||||
用 mozilla 開網頁,選取列印,然後用 /usr/ports/print/gv 來觀看,
|
||||
這樣子就會看到中文的 ps 囉。</para>
|
||||
<para>
|
||||
不過可以看到,並沒有粗體與斜體的相關設定,筆者在 CIDFnmap 並沒有找到
|
||||
粗體與斜體的相關設定,不過這對 mozilla 而言是足夠的</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>why MSung-Light?</title>
|
||||
<para>
|
||||
MSung-Light 與 MHei-Medium 則是許多軟體預設的 CID fontmap,
|
||||
都把他連到 ShanHeiSun-Light 與 ZenKai-Medium,
|
||||
而 STSong-Light 則是預設的簡體 CID fontmap,
|
||||
日文用 HeiseiMin-W3 與 HeiseiKakuGo-W5,
|
||||
韓文則是 HyGoThic-Medium 與 HYSMyeongJo-Medium</para>
|
||||
<para>
|
||||
ShanHeiSun-Light 的來源是 ttfinfo /usr/local/share/fonts/TrueType/bsmi00lp.ttf
|
||||
的 TTFINFO_FONT_PSNAME="ShanHeiSun-Light"</para>
|
||||
<programlisting>
|
||||
TTFINFO_FONT_FILE="/usr/local/share/fonts/TrueType/bsmi00lp.ttf"
|
||||
TTFINFO_FONT_NAME="AR PL Mingti2L Big5"
|
||||
TTFINFO_FONT_PSNAME="ShanHeiSun-Light"
|
||||
TTFINFO_FOUNDRY_NAME="Arphic"
|
||||
TTFINFO_WEIGHT_NAME="medium"
|
||||
TTFINFO_WIDTH="normal"
|
||||
TTFINFO_NUMCMAP="2"
|
||||
TTFINFO_CMAP0="1,0"
|
||||
TTFINFO_CMAPNAME0="Apple,Roman"
|
||||
TTFINFO_CMAP1="3,1"
|
||||
TTFINFO_CMAPNAME1="Windows,Unicode"
|
||||
TTFINFO_MAPNUM="1"
|
||||
TTFINFO_FONTMAP1="-Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-big5-0"</programlisting>
|
||||
<para>
|
||||
目前已經有類似的 ports,/usr/ports/japanese/ghostscript-gnu-jpnfont/
|
||||
剛我也 send-pr 去修改 /usr/ports/print/ghostscript-gnu-commfont 了</para>
|
||||
</sect2>
|
||||
<sect2 id="test-cidfnmap">
|
||||
<title>修改 CIDFnmap 的測試</title>
|
||||
<para></para>
|
||||
<programlisting>
|
||||
% cat cid.ps
|
||||
/MSung-Light-B5-H findfont 60 scalefont setfont
|
||||
50 600 moveto (2002年 5月29日) show
|
||||
/MHei-Medium-B5-H findfont 60 scalefont setfont
|
||||
50 520 moveto (2002年 5月29日) show
|
||||
/MOESung-Regular-B5-H findfont 60 scalefont setfont
|
||||
50 440 moveto (2002年 5月29日) show
|
||||
/MOEKai-Regular-B5-H findfont 60 scalefont setfont
|
||||
50 360 moveto (2002年 5月29日) show
|
||||
showpage
|
||||
quit
|
||||
% gv -antialias cid.ps
|
||||
% ps2pdf cid.ps
|
||||
% xpdf cid.pdf</programlisting>
|
||||
<figure>
|
||||
<title>20020527 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/20020527" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
以下是 mozilla.ps 的 zh_TW 區段,mozilla 的列印正常</para>
|
||||
<programlisting>
|
||||
/Unicode2NativeDictzh-TW 0 dict def
|
||||
/zh-TW_ls {
|
||||
/NativeFont /MSung-Light-B5-H def
|
||||
/UCS2Font /Courier def
|
||||
/Unicode2NativeDict Unicode2NativeDictzh-TW def
|
||||
/unicodeshow1 { real_unicodeshow } bind def
|
||||
/unicodeshow2 { real_unicodeshow_native } bind def
|
||||
} bind def</programlisting>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>KDE3 的 kword 仍然有問題</title>
|
||||
<para>
|
||||
以下是 kword.ps 的 zh_TW 區段,kde3 的 kword 列印仍然有問題</para>
|
||||
<programlisting>
|
||||
%%BeginSetup
|
||||
% Fonts and encodings used
|
||||
/MSung-Light-B5-HList [
|
||||
[ /MSung-Light-B5-H 1 0 ]
|
||||
[ /MOESung-Regular-B5-H 1 0 ]
|
||||
[ /Helvetica 1.18991 0 ]
|
||||
] d
|
||||
% Asian postscript font requested. Using MSung-Light-B5-H
|
||||
/MSung-Light-B5-HList [
|
||||
[ /MSung-Light-B5-H 1 0.2 ]
|
||||
[ /MOESung-Regular-B5-H 1 0.2 ]
|
||||
[ /Helvetica-Oblique 1.18991 0 ]
|
||||
] d
|
||||
% Asian postscript font requested. Using MSung-Light-B5-H
|
||||
/MSung-Light-B5-HList [
|
||||
[ /MSung-Light-B5-H 1 0 ]
|
||||
[ /MOESung-Regular-B5-H 1 0 ]
|
||||
[ /Helvetica-Bold 1.12803 0 ]
|
||||
] d
|
||||
% Asian postscript font requested. Using MSung-Light-B5-H
|
||||
/F1 30.375/MSung-Light-B5-H-Uni DF
|
||||
/F2 30.375/MSung-Light-B5-H-Uni DF
|
||||
/F3 30.375/MSung-Light-B5-H-Uni DF
|
||||
%%EndSetup</programlisting>
|
||||
<para>
|
||||
但是用 gs 來看就會有如下的錯誤訊息</para>
|
||||
<programlisting>
|
||||
GNU Ghostscript 7.05 (2002-04-22)
|
||||
Copyright (C) 2002 artofcode LLC, Benicia, CA. All rights reserved.
|
||||
This software comes with NO WARRANTY: see the file PUBLIC for details.
|
||||
Can't find (or can't open) font file /usr/local/share/ghostscript/Resource/Font/MSung-Light-B5-H-Uni.
|
||||
Can't find (or can't open) font file MSung-Light-B5-H-Uni.
|
||||
Substituting font Courier for MSung-Light-B5-H-Uni.
|
||||
Loading NimbusMonL-Regu font from /usr/local/share/ghostscript/fonts/n022003l.pfb... 18883696 17394664 1743000 367192 0 done.
|
||||
Can't find (or can't open) font file /usr/local/share/ghostscript/Resource/Font/MSung-Light-B5-H-Uni.
|
||||
Can't find (or can't open) font file MSung-Light-B5-H-Uni.
|
||||
Substituting font Courier for MSung-Light-B5-H-Uni.
|
||||
Can't find (or can't open) font file /usr/local/share/ghostscript/Resource/Font/MSung-Light-B5-H-Uni.
|
||||
Can't find (or can't open) font file MSung-Light-B5-H-Uni.
|
||||
Substituting font Courier for MSung-Light-B5-H-Uni.
|
||||
>>showpage, press to continue<<</programlisting>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>fonts.dir 的粗體與斜體</title>
|
||||
<para>
|
||||
回過頭來看 fonts.dir 的設定方式</para>
|
||||
<programlisting>
|
||||
bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-以下略
|
||||
ai=0.3:bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-以下略
|
||||
ds=y:bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-以下略
|
||||
ds=y:ai=0.3:bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-以下略</programlisting>
|
||||
<para>
|
||||
第一個是正常的字體。
|
||||
ai 代表 Automatic Italic 會造成斜體。後面的數字是傾斜比例。
|
||||
ds 代表 Double Strike 會造成偽粗體。y 代表 yes,表示要粗體。
|
||||
兩個一起用就變成粗斜體了。</para>
|
||||
<para>
|
||||
當然,以上在 ttfm 的模組應該都會自動產生,但也可以自己去手動
|
||||
調整。也可以利用 fs=p 來調整成調合字(proportional font)。另外,
|
||||
要使用 MS 的新細明,可以加上 eb=y 來強迫 FreeType 去使用內嵌
|
||||
於字型內的點陣字(會比 AA 好看,不過這個功能不是很穩定)。</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>gscjk 的粗體與斜體</title>
|
||||
<para>
|
||||
以文鼎宋體為例,PSNAME 是 ShanHeiSun-Light,而我們常用的 CMap 是
|
||||
ETen-B5-H,所以 gscjk 的字型就會有 'ShanHeiSun-Light-ETen-B5-H'、
|
||||
'ShanHeiSun-Light-Bold-ETen-B5-H'、'ShanHeiSun-Light-Italic-ETen-B5-H'、
|
||||
'ShanHeiSun-Light-BoldItalic-ETen-B5-H',Bold 是粗體,Italic 是斜體,
|
||||
BoldItalic 是粗斜體,這樣就有了我們常用的字體了。</para>
|
||||
<para>
|
||||
接著,gscjk 就會在 /usr/local/share/ghostscript/Resource/CIDFont/
|
||||
底下產生 ShanHeiSun-Light ShanHeiSun-Light-Bold ShanHeiSun-Light-BoldItalic
|
||||
ShanHeiSun-Light-Italic,並在 /usr/local/share/ghostscript/Resource/Font/
|
||||
底下產生與繁體中文 CMap 相結合的字型。</para>
|
||||
<para>
|
||||
在此的產生方式是透過 ttfm.sh 的 gscjk module,可以直接使用 ports 中的版本,
|
||||
檢察 /usr/local/share/ttfm 底下是否有 gscjk.ttfm 即可,ttfm 的使用方式
|
||||
則自己參考 manual 或是網頁</para>
|
||||
<programlisting>
|
||||
/ShanHeiSun-Light-B5-H findfont 60 scalefont setfont
|
||||
50 600 moveto (2002年 5月29日) show
|
||||
/ShanHeiSun-Light-Bold-B5-H findfont 60 scalefont setfont
|
||||
50 520 moveto (2002年 5月29日) show
|
||||
/ShanHeiSun-Light-Italic-B5-H findfont 60 scalefont setfont
|
||||
50 440 moveto (2002年 5月29日) show
|
||||
/ShanHeiSun-Light-BoldItalic-B5-H findfont 60 scalefont setfont
|
||||
50 360 moveto (2002年 5月29日) show
|
||||
showpage
|
||||
quit</programlisting>
|
||||
<figure>
|
||||
<title>20020527-2 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/20020527-2" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect2>
|
||||
<sect2 id="abiword-print">
|
||||
<title>AbiWord 的粗體與斜體</title>
|
||||
<para>以下只適用於 <filename role="package">editors/AbiWord</filename>,
|
||||
如果是使用 <filename role="package">editors/AbiWord2</filename>
|
||||
請參考 gtk2 的設定方式。</para>
|
||||
<para>
|
||||
AbiWord 也同樣的可以列印粗體與斜體。AbiWord 的字型目錄在
|
||||
/usr/X11R6/share/AbiSuite/fonts,在其內先建立 zh-TW 目錄
|
||||
接著只要利用 ttf 來建立 fonts.dir 就可以了。</para>
|
||||
<para>格式如下:</para>
|
||||
<programlisting>
|
||||
PSFONT, TTFFONT, 880, 120, 1000</programlisting>
|
||||
<para>所以就建立如下的 fonts.dir</para>
|
||||
<programlisting>
|
||||
4
|
||||
ShanHeiSun-Light-ETen-B5-H, -Arphic-AR PL Mingti2L Big5-medium-r-normal--0-0-0-0-c-0-big5-0, 880, 120, 1000
|
||||
ShanHeiSun-Light-Bold-ETen-B5-H, -Arphic-AR PL Mingti2L Big5-bold-r-normal--0-0-0-0-c-0-big5-0, 880, 120, 1000
|
||||
ShanHeiSun-Light-Italic-ETen-B5-H, -Arphic-AR PL Mingti2L Big5-medium-i-normal--0-0-0-0-c-0-big5-0, 880, 120, 1000
|
||||
ShanHeiSun-Light-BoldItalic-ETen-B5-H, -Arphic-AR PL Mingti2L Big5-bold-i-normal--0-0-0-0-c-0-big5-0, 880, 120, 1000</programlisting>
|
||||
<para>
|
||||
利用 -medium-r 對應普通字型,-bold-r 對應 -Bold,-medium-i 對應 -Italic,
|
||||
-bold-i 對應 -BoldItalic。</para>
|
||||
<para>
|
||||
不過我都還必須在 zh-TW 底下 touch .already-in-fp,abiword 才不會說</para>
|
||||
<programlisting>
|
||||
Abiword could not load the following font or fontset from the X Window System display server:
|
||||
[-*-Times New Roman-regular-r-*-*-*-0-*-*-*-*-*-*]</programlisting>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>kde2 的中文列印 [OBSOLETE]</title>
|
||||
<para>kde2.2.2 中文列印所需要的 PSNAME 是 MSung-Light 和 MHei-Medium,
|
||||
所以在 ttfm.sh 搭配 gscjk.ttfm 後可以在
|
||||
/usr/local/share/ghostscript/7.05/lib/CIDFnmap 的最後加上兩行來 alias</para>
|
||||
<programlisting>
|
||||
/MSung-Light /ShanHeiSun-Light ;
|
||||
/MHei-Medium /ZenKai-Medium ;</programlisting>
|
||||
<para>
|
||||
還是要在 gscjk.ttfm 中作 -setdefault 時 alias 一個成 MSung-Light?</para>
|
||||
<para>
|
||||
另外遇到一個問題,kde2 用 print to pdf 中文,內建的 viewer 可以看的見
|
||||
但是 xpdf 則會有問題,xpdf-1.01
|
||||
而 print to ps 內建的 viewer 看不見,但是 gs gv 都看的見</para>
|
||||
<para>
|
||||
以下是 xpdf 的 error msg</para>
|
||||
<programlisting>
|
||||
Error: Unknown font tag 'R14'
|
||||
Error (1850): No font in show</programlisting>
|
||||
<figure>
|
||||
<title>kde-print snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/kde-print" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bg5pdf">
|
||||
<title>bg5pdf - 轉換中文 Big5 編碼文件成為不內嵌的 PDF</title>
|
||||
<para>
|
||||
這是由 Chen-Shan Chin 使用 python 及 PDFLib 所寫的軟體,直接由中文
|
||||
big5 txt 轉成中文 pdf 檔,使用不內嵌的 Acrobat Reader
|
||||
的中文 CIDKeyed font,可以使檔案變得非常的小
|
||||
(只是註冊了中文字型的名稱而已),
|
||||
只是目前只有固定大小的字體可用,
|
||||
無法做出標題之類的變化。好處是,
|
||||
可以做 copy & paste 及有 search 的功能。</para>
|
||||
<para>安裝 <filename role="package">chinese/bg5pdf</filename>。</para>
|
||||
<para>測試:</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>echo "中文測試" > test.txt</userinput>
|
||||
&prompt.user; <userinput>bg5pdf test.txt</userinput>
|
||||
Output File is test.txt.pdf
|
||||
&prompt.user; <userinput>pdffonts test.txt.pdf</userinput>
|
||||
name type emb sub uni object ID
|
||||
------------------------------------ ------------ --- --- --- ---------
|
||||
MSung-Light-ETen-B5-H CID Type 0 no no no 7 0
|
||||
Helvetica-Oblique Type 1 no no no 8 0
|
||||
</screen>
|
||||
<figure>
|
||||
<title>bg5pdf snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/bg5pdf" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://students.washington.edu/cschin/">
|
||||
http://students.washington.edu/cschin/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="bg5ps">
|
||||
<title>bg5ps - 使用 TTF 字型轉換中文 Big5/GB 編碼文件成為 Portscript</title>
|
||||
<para>
|
||||
<application>bg5ps</application> 是一個使用巨蟒描述語言
|
||||
(Python Scrpting Language)寫的一個小程式,能夠利用幾套免費的
|
||||
Truetype 中文字型將一般用 BIG5 編碼的文字檔轉換成能夠在
|
||||
沒有中文字型的 postscript 印表機或是只有 ghostscript
|
||||
的系統上印列的 postscript 檔案。 <application>bg5ps</application>
|
||||
也可以拿來當做過濾器(filter),用來過濾在 FreeBSD 上的
|
||||
<application>Netscape</application> 或是 mpage 產生的
|
||||
postscript 檔案來印列其中所包含的 BIG5 中文字元。因為
|
||||
<application>bg5ps</application> 使用的是 Truetype
|
||||
字型而非矩陣字型,當在雷射印表機上或是字型較大時,
|
||||
可以獲得比較好的印列品質。 </para>
|
||||
<para>安裝 <filename role="package">bg5ps</filename>。</para>
|
||||
<para>
|
||||
目前 <application>bg5ps</application> 是採用
|
||||
<application>moettf</application> 為列印的字型。您必須設定
|
||||
TTF 字型路徑,在安裝完之後,您必須參考
|
||||
<filename>/usr/local/etc/bg5ps/bg5ps.conf.sample</filename>
|
||||
,並將您的設定檔置於 <filename>~/.bg5ps.conf</filename> 或
|
||||
<filename>/usr/local/etc/bg5ps/bg5ps.conf</filename>。</para>
|
||||
<para>
|
||||
用它所附的範例來測試,並用 <application>ghostview</application> 或
|
||||
<application>gv</application> 觀看結果: </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>cd /usr/local/share/doc/bg5ps</userinput>
|
||||
&prompt.user; <userinput>bg5ps -if bg5ps.txt -of bg5ps.ps</userinput>
|
||||
&prompt.user; <userinput>ghostview bg5ps.ps</userinput> </screen>
|
||||
<para><command>bg5ps -h</command> 來看有那些參數可以使用。</para>
|
||||
<para>使用方法</para>
|
||||
<para>
|
||||
bg5ps 可以以獨立(stand along)或是當成過濾器(filter)來使用。 </para>
|
||||
<para>以獨立方式執行。</para>
|
||||
<para>
|
||||
如果您的設定檔沒有問題,在大多數的時候您只須下達 </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>bg5ps -if yourfile.big5 -of yourfile.ps</userinput> </screen>
|
||||
<para>
|
||||
就可以將 big5 編碼的檔案轉成可以印列的 postscript 檔案。 在大部份的
|
||||
類 UNIX 的系統裡,使用 </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>lpr yourfile.ps</userinput> </screen>
|
||||
<para>
|
||||
就可將 postscript 檔案印出。需要注意的是您必須要有 postscript 印表
|
||||
機或是用 ghostscript 模擬 postscript 的印表 機及印表過濾器。此外您
|
||||
還需要確定您是否正確的指定印表機。
|
||||
如果您想要將 mpage 及 netscape 所產生的 postscript中的 big5 碼做處
|
||||
理,使其成為可以印列 big5 中文的 postscript檔。 那您需要加上 "-nps
|
||||
y" 這個選項如下 </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>bg5ps -nps y -if netscape.ps -of cnetscape.ps</userinput> </screen>
|
||||
<para>
|
||||
因為在 netscape 產生的 postscript 檔中的英文是可變寬度的字型, 所以
|
||||
有時會有和中文對不齊的狀況發生。如用 mpage 則沒有這方面 的問題。用
|
||||
mpage+bg5ps 是用來預覽大的中文檔案節省紙張的好方案。 </para>
|
||||
<para>當成過濾器使用。</para>
|
||||
<para>
|
||||
bg5ps 也可以利用 UNIX 中的管道(pipe)當成過濾器使用。方法如下 </para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>cat yourfile.big5 | bg5ps > yourfile.ps</userinput>
|
||||
&prompt.user; <userinput>cat yourfile.big5 | bg5ps | lpr</userinput> </screen>
|
||||
<para>或</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>cat netscape.ps | bg5ps -nps y > yourfile.ps</userinput>
|
||||
&prompt.user; <userinput>cat netscape.ps | bg5ps | lpr</userinput> </screen>
|
||||
<para>選項</para>
|
||||
<programlisting>
|
||||
bg5ps 有下列的選項可以使用
|
||||
* -fp ChineseFontPath: 指定中文字型的路徑(預設值: 與 bg5ps 同)
|
||||
* -fn ChineseFontName: 指定中文字型的檔案名稱(預設值: ntu_kai)
|
||||
* -o [0|1]: 0 不輸出奇數頁,1 輸出奇數頁(預設值: 1)
|
||||
* -e [0|1]: 0 不輸出偶數頁,1 輸出偶數頁(預設值: 1)
|
||||
* -s num: 指定輸出字型的大小(預設值: 12)
|
||||
* -ls num: 指定行距(預設值: 6.0)
|
||||
* -cs num: 指定字距(預設值: 2.0)
|
||||
* -lm num: 指定左邊界(預設值: 72.0)
|
||||
* -rm num: 指定右邊界(預設值: 72.0)
|
||||
* -tm num: 指定上邊界(預設值: 72.0)
|
||||
* -bm num: 指定下邊界(預設值: 72.0)
|
||||
* -if filename: 指定輸入檔檔名
|
||||
* -of filename: 指定輸出檔檔名
|
||||
* -cf filename: 指定設定檔(預設值: /.bg5ps.conf)
|
||||
* -nps [y|n]: y 使用 nps 模式,n 不使用 nps 模式(預設值: n)
|
||||
</programlisting>
|
||||
<para>範例</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>bg5ps -fn ntu_kai -e 0 -o 1 -s 18 -cs 3 -if mybig5.txt -of myps.ps</userinput> </screen>
|
||||
<para>設定檔(Configuration file)</para>
|
||||
<para>
|
||||
bg5ps 的設定檔其實每一行都是 python script 語言的一 行指令,由 bg5ps
|
||||
主程式去呼叫執行,所以可能有安全性上的 問題。請記得要將設定檔改成唯讀。
|
||||
因為設定檔也是 python script,所以每一行的開始是不能有空格的。 </para>
|
||||
<programlisting>
|
||||
bg5ps 設定檔有下列參數可以改變
|
||||
* chineseFontPath: 指定中文字型的路徑(預設值: 與 bg5ps 同)
|
||||
* fontName: 指定中文字型的檔案名稱(預設值: ntu_kai)
|
||||
* oddPages: 0 不輸出奇數頁,1 輸出奇數頁(預設值: 1)
|
||||
* evenPages: 0 不輸出偶數頁,1 輸出偶數頁(預設值: 1)
|
||||
* size: 指定輸出字型的大小(預設值: 12)
|
||||
* lineSpace: 指定行距(預設值: 6.0)
|
||||
* chrSpace: 指定字距(預設值: 2.0)
|
||||
* leftMargin: 指定左邊界(預設值: 72.0)
|
||||
* rightMargin: 指定右邊界(預設值: 72.0)
|
||||
* topMargin: 指定上邊界(預設值: 72.0)
|
||||
* bottomMargin: 指定下邊界(預設值: 72.0) </programlisting>
|
||||
<para>範例:</para>
|
||||
<programlisting>
|
||||
chineseFontPath="/home/cschin/lib/cfonts"
|
||||
fontName="ntu_kai"
|
||||
oddPages=1
|
||||
evenPages=1 </programlisting>
|
||||
<note>
|
||||
<para>
|
||||
如果在 <application>netscape</application>
|
||||
的列印指令裡面把 "<command>lpr</command>" 換成
|
||||
"<command>bg5ps -nps y | lpr</command>",就可以列印中文網頁了。 </para>
|
||||
</note>
|
||||
<figure>
|
||||
<title>bg5ps snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/bg5ps" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>
|
||||
WWW: <ulink url="http://students.washington.edu/cschin/">
|
||||
http://students.washington.edu/cschin/</ulink>
|
||||
</para>
|
||||
<para>
|
||||
Author: &a.cschin;
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="enscript">
|
||||
<title>enscript - 直接使用 CID-font 來列印</title>
|
||||
<para>
|
||||
這一版的 <application>ensctipt</application> 是由
|
||||
&a.cschin; 的
|
||||
補丁來支援 Big5 和 UniCNS-UTF8 編碼的純文字檔。
|
||||
兩個新的編碼名稱, "big5" 和 "UniCNS-UTF8" 是新增的。
|
||||
Since there is no easy way to get AFM for CJK CID-font,
|
||||
I simply assign the width for the same for all character. </para>
|
||||
<para>
|
||||
You need to have a CID-font for these encoding to use
|
||||
this function. </para>
|
||||
<para>安裝 <filename role="package">chinese/enscript</filename>。</para>
|
||||
<para>使用 <application>enscript</application></para>
|
||||
<programlisting>
|
||||
For BIG5 users, use commands like this to generate PS documents:
|
||||
enscript -X big5 -f DefaultMingB5-Regular-B5pc-H@12 -o [output.ps] [file]
|
||||
Make sure to use those fonts having "B5pc" in their names.</programlisting>
|
||||
<para>
|
||||
Author WWW: <ulink url="http://students.washington.edu/cschin/bg5ps/enscript-TW-support/">
|
||||
http://students.washington.edu/cschin/bg5ps/enscript-TW-support/</ulink></para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.gnu.org/software/enscript/enscript.html">
|
||||
http://www.gnu.org/software/enscript/enscript.html</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gb2ps">
|
||||
<title>gb2ps - 轉換中文 GB 編碼文件成為 PostScript</title>
|
||||
<para>
|
||||
<application>gb2ps</application> 是另一種可以列印
|
||||
GB 與 HZ 編碼的工具程式。 </para>
|
||||
<para>安裝 <filename role="package">chinese/gb2ps</filename>。</para>
|
||||
<para>字型:</para>
|
||||
<programlisting>
|
||||
csong24.ccf ckai24.ccf
|
||||
cfang24.ccf chei24.ccf
|
||||
<ulink url="ftp://ftp.ifcss.org/pub/software/fonts/gb/misc/">
|
||||
ftp://ftp.ifcss.org/pub/software/fonts/gb/misc/</ulink> </programlisting>
|
||||
<para>
|
||||
將字型放在某個目錄下,例如
|
||||
<filename>/usr/local/lib/chinese/CFONT</filename> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gbscript">
|
||||
<title>gbscript - 轉換中文 GB 編碼文件成為 PostScript</title>
|
||||
<para>
|
||||
轉換簡體字(GB)成 PostScript 檔一個可將中文字轉成 PS 格式的程式。 </para>
|
||||
<para>安裝 <filename role="package">chinese/gbscript</filename>。</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tocps">
|
||||
<title>tocps - 轉換中文編碼文件成為 PostScript</title>
|
||||
<para>
|
||||
解譯 <application>Netscape</application> 另存新檔的
|
||||
PostScript 檔案,成為可列印的中文(GB)
|
||||
PostScript 檔案。 </para>
|
||||
<para>安裝 <filename role="package">chinese/tocps</filename> 的安裝:</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="vflib">
|
||||
<title>vflib - 使用自由向量字型的向量字型函式庫,支援 BIG5 和 GB</title>
|
||||
<para>TurboLinux 採用的 VFlib + gs 5.5 來做中文列印,
|
||||
將 VFlib patch 加到 gs 5.5 上去,因為 gs 5.5 不像 gs6
|
||||
本身已經支援中文字,因此要透過 VFlib 來處理中文字,
|
||||
效果不錯,而且又能夠印出斜體等變化字體。</para>
|
||||
<para>在日本,比較常用的解決方法,就是利用 "VFlib patch" 讓 ghostscript
|
||||
能夠使用一些商用的日文外框字型,點陣字型和 TrueType 字型,
|
||||
同時 PostScript 程式透過這些 VFlib 修補,
|
||||
也能夠將這些字型當作 OCF(original composite font)
|
||||
的字型來使用。</para>
|
||||
<para>
|
||||
WWW: <ulink url="http://TypeHack.aial.hiroshima-u.ac.jp/VFlib/">
|
||||
http://TypeHack.aial.hiroshima-u.ac.jp/VFlib/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cnprint">
|
||||
<title>cnprint</title>
|
||||
<para>cnprint 是一個將中文文章轉換為 PostScript 檔案以供列印的工具。
|
||||
使用上就和標準的列印指令一樣。它同時支援 GB, HZ 與 BIG5 編碼。
|
||||
cnprint 可以處理 Chinese/Japanese/Korean 文件轉換,DOS、VMS、UNIX 系統下,
|
||||
都能使用。支援 GB, Hz, zW, BIG5, CNS, JIS, EUC, Shift-JIS, KSC, UTF8,
|
||||
UTF7, UTF16 等等格式。同時也支援 HBF『 Hanzi Bitmap Format』、
|
||||
TTF『TrueType Format』字型。</para>
|
||||
<para>安裝 <filename role="package">chinese/cnprint</filename>。</para>
|
||||
<para>WWW: <ulink url="http://www.neurophys.wisc.edu/%7Ecai/software/">
|
||||
CAI's Software Page - cnprint</ulink></para>
|
||||
<para>WWW: <ulink url="http://www.twics.com/%7Ecraig/writings/linux-nihongo/node68.html">
|
||||
Japanese Printing and Text Processing With Linux</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="wprint">
|
||||
<title>wprint</title>
|
||||
<para>Last Update: 2003年 1月29日 周三 06時24分36秒 CST</para>
|
||||
<para>Contributed by 陳漢儀 ( moto@chuany.net )</para>
|
||||
<para>Wprint is a filter for Mozilla (Galeon, etc.), Htmldoc, and Netscape PostScript output that uses TrueType fonts to allow the printing of pages written in Unicode, Big5, KOI8, SJIS, the ISO-8859* charsets, and others.</para>
|
||||
<para>安裝 <filename role="package">print/wprint</filename>。</para>
|
||||
<para>若要直接列印,
|
||||
修改 <filename>/usr/local/etc/wprint.conf</filename>,
|
||||
加入底下兩行:</para>
|
||||
<programlisting>
|
||||
fontpath:/usr/local/share/fonts/TrueType/
|
||||
default:EUC-TW:bkai00mp.ttf=zh_TW.Big5:|lpr -P lp</programlisting>
|
||||
<para>fontpath 的實際位置請依照您系統的目錄架構,
|
||||
另外 ttf 字型請依照自己需求修改,
|
||||
本例子採用文鼎中楷體 ( bkai00mp )。</para>
|
||||
<para>若要列印成 ps 檔案,
|
||||
修改 <filename>/usr/local/etc/wprint.conf</filename>,
|
||||
加入底下兩行:</para>
|
||||
<programlisting>
|
||||
fontpath:/usr/local/share/fonts/TrueType/
|
||||
default:EUC-TW:bkai00mp.ttf=zh_TW.Big5:mybig5.ps</programlisting>
|
||||
<para>設定最後一行的最後一欄中文 ps 檔案名稱可自訂,
|
||||
這裡隨意以mybig5.ps 為例,當在 mozilla 中選擇列印到檔案時,
|
||||
您的 $HOME 會出現 mozilla.ps ( mozilla 預設產生 ) 與 mybig5.ps
|
||||
( wprint 轉換成中文後的 ps 檔 )。</para>
|
||||
<para>以更改 mozilla 印表機選項為例,原來的列印流程:</para>
|
||||
<programlisting>mozilla -> print -> lpr</programlisting>
|
||||
<para>現在我們要改成:</para>
|
||||
<programlisting>mozilla -> print -> wprint -> lpr</programlisting>
|
||||
<para>設定步驟如下:
|
||||
請選擇下拉選單的 『 列印 』-> 點選 『 印表機 』 右側的 『 屬性 』鍵 ->
|
||||
將 『印命令 』由原來的
|
||||
『 lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME} 』
|
||||
改為 『 wprint 』</para>
|
||||
<para>WWW: <ulink url="http://ttt.esperanto.org.uy/programoj/angle/wprint.html">
|
||||
http://ttt.esperanto.org.uy/programoj/angle/wprint.html</ulink></para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,346 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.67
|
||||
-->
|
||||
|
||||
<chapter id="software">
|
||||
<title>有用的中文軟體</title>
|
||||
<para>以下介紹的都是在 <filename>ports/chinese</filename> 底下的套件。</para>
|
||||
|
||||
<sect1 id="FreeWnn">
|
||||
<title>FreeWnn</title>
|
||||
<para>一個可輸入日文/中文/韓文的工具(這裏只包含中文) 這是個較適合
|
||||
日本人來輸入中文的工具 :-) 和我們常用的輸法習慣有頗大的差距,
|
||||
有興趣的人可試試。 </para>
|
||||
<para>WWW: <ulink url="http://www.freewnn.org/">
|
||||
freewnn project</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="acroread5-chtfont">
|
||||
<title>acroread5-chtfont - Acrobat Reader 5.0 的 PDF 閱讀軟體</title>
|
||||
<para><filename role="package">chinese/acroread5-chtfont</filename> 是
|
||||
Acrobat Reader 5.0 的繁體字型檔案,
|
||||
用來觀看不內嵌中文字的 PDF 檔用。
|
||||
如果只安裝 <filename role="package">print/acroread5</filename>
|
||||
則只能觀看英文 PDF 和內嵌字型的中文 PDF。
|
||||
由於 <filename role="package">print/acroread5</filename>
|
||||
需要 <filename role="package">emulators/linux_base</filename>,
|
||||
所以筆者通常改用 <filename role="package">chinese/xpdf</filename>
|
||||
或是 <filename role="package">print/gv</filename> 來觀看。</para>
|
||||
<!--<para>使用前請先 <command>env XMODIFIERS=acrobat</command>。</para>-->
|
||||
<figure>
|
||||
<title>acroread snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/acroread" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.adobe.com/prodindex/acrobat/readstep.html">
|
||||
http://www.adobe.com/prodindex/actobat/readstep.html</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="clebase">
|
||||
<title>cle_base - 利用 CLE 所提供的中文 L10N [OBSOLETE]</title>
|
||||
<para>利用 CLE(Chinese Linux Extension) 所提供給 GNU/Linux
|
||||
的中文 L10N 來完成中文化,目前是以 RedHat 的發行版本為主。
|
||||
這個 port 只有選取 CLE 安裝時的基本套件。
|
||||
除了是一個 GNU/Linux 模擬器外,也可以在上面執行 L10N GNU/Linux
|
||||
軟體,例如 <application>Netscape</application> 或是
|
||||
<application>Star Office</application>。 </para>
|
||||
<para>在安裝 GNU/Linux base 成功後,還必須將 GNU/Linux kernel 模式開啟,
|
||||
這樣才能讓 GNU/Linux 的執行檔運作。
|
||||
GNU/Linux 模式可以經由修改 <filename>rc.conf</filename>
|
||||
來將 linux_enable 開啟,請參考 rc.conf(5)。 </para>
|
||||
<para>如果有使用 NIS,別忘了要修改 /compat/linux/etc 中的
|
||||
<filename>yp.conf</filename>。 </para>
|
||||
<para>WWW: <ulink url="http://cle.linux.org.tw">
|
||||
http://cle.linux.org.tw</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="cless">
|
||||
<title>cless - 一個較好用的分頁閱讀程式</title>
|
||||
<para>一個較好用的分頁閱讀程式,並且中文相容用和
|
||||
<application>more</application> 或 <application>pg</application>
|
||||
類似,但功能更強大,且中文相容。 </para>
|
||||
<para>不過如果不需要介面中文化的話,內建的 <command>less -r</command>
|
||||
已經很夠了。 </para>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.flash.net/~marknu/less/">cless project</ulink>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="dia">
|
||||
<title>Dia - 類似 Vision 的流程設計軟體 [OBSOLETE]</title>
|
||||
<para>Dia 是一套建構在 GTK+ 上的流程設計軟體,並使用 GPL 版權散佈。 </para>
|
||||
<para>Dia 被設計成與商業版的視窗軟體 'Visio' 十分類似。
|
||||
它可以被用來繪不同種類的流程圖。
|
||||
在這個第一版中,也支援了 UML 靜態結構流程圖和網路流程圖。
|
||||
它目前可以讀取和儲存流程圖到自定的檔案格式和匯出成 postscript。 </para>
|
||||
<para>WWW: <ulink url="http://www.lysator.liu.se/~alla/dia/">
|
||||
dia project</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="firebird">
|
||||
<title>Firebird - BBS 伺服器</title>
|
||||
<para>Firebird BBS 是一個 BBS 伺服器,有著 news 能力和許多其他功能。
|
||||
它包含了 mail/news/talk/irc 且只需要使用 telnet。 </para>
|
||||
<para>它在繁體中文網際網路環境中廣泛的被使用,它也有 GB 編碼的版本,
|
||||
但是目前還沒辦法取得。 </para>
|
||||
<para>WWW: <ulink url="http://www.firebird.org.tw">
|
||||
firebird project</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="fortunetw">
|
||||
<title>fortunetw - 唐詩三百首與易經</title>
|
||||
<para>在安裝完後,只要使用 <command>/usr/games/fortune
|
||||
${PREFIX}/share/games/fortune/tangshi</command> 或是
|
||||
<command>/usr/games/fortune ${PREFIX}/share/games/fortune/yijing
|
||||
</command> 就可以有隨機的唐詩三百首或是易經。</para>
|
||||
<figure>
|
||||
<title>fortunetw snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/fortunetw" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gnumeric">
|
||||
<title>Gnumeric - GNOME 報表軟體</title>
|
||||
<para>Gnumeric 是一個好用的報表軟體,只要您會用 Excel
|
||||
便會使用本軟體,操作方式簡直跟 Excel 一模一樣。 </para>
|
||||
<para>本軟體為了跟各個有名的報表軟體相容,更提供了可以開啟
|
||||
Excel、Lotus 1-2-3、Applix、Sylk、XBase 及 Oleo 等等的檔案。 </para>
|
||||
<para>WWW: <ulink url="http://www.gnome.org/gnome-office/gnumeric.shtml">
|
||||
gnumeric project</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="hanzim">
|
||||
<title>hanzim - 中文字學習軟體</title>
|
||||
<para>設計用來幫助您記憶中文字,使用該字的多種意思。
|
||||
會顯示該字相同的字根,剩下的部份,發音,漢語拼音發音。</para>
|
||||
<figure>
|
||||
<title>hanzim snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/hanzim" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://zakros.ucsd.edu/~arobert/hanzim.html">
|
||||
hanzim project</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="libtabe">
|
||||
<title>libtabe - xcin 的中文處理函式庫</title>
|
||||
<para>在電腦上處理中文,跟原有的 C 函式庫一直很難順利的整合。以 Big5
|
||||
碼來說,一個字佔了兩個 byte,不管是計算字串長度,
|
||||
或者是要考慮中文字的字序,甚至要處理詞或句子的時候,
|
||||
都需要做特別的調整,原有的 C 函式庫根本不敷使用。另一方面,
|
||||
由於每個程式開發人員在處理中文的時候,都有自己的方法,
|
||||
所以不同程式之間很難分享函式庫,更不用提重覆利用了。TaBE
|
||||
計畫希望能夠提供一個更好的中文使用環境,因此,
|
||||
就很需要一個能處理中文字、詞、句的統一介面與函式庫,
|
||||
來做為所有應用程式的基礎。libtabe,就是希望成為這樣的一套函式庫,
|
||||
提供統一的介面與足夠的功能,讓應用程式有強大的基礎可以發揮。 </para>
|
||||
<para>WWW: <ulink url="http://xcin.linux.org.tw/libtabe/index.html">
|
||||
Libtabe is Used in XCIN</ulink> </para>
|
||||
<para>
|
||||
WWW: <ulink url="http://gusp.dyndns.org/doc/libtabe-db/libtabe.html">
|
||||
http://gusp.dyndns.org/doc/libtabe-db/libtabe.html</ulink>[OBSOLETE]</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="linar">
|
||||
<title>lunar - 轉換陽曆和陰曆的對應日期</title>
|
||||
<para>轉換陽曆和陰曆把陽曆的日期轉成對應的陰曆日期,
|
||||
也可把陰曆日期轉成對應的陽曆日期,此程式也印出生肖和天甘地支
|
||||
,適用於西元 1900 年至 西元 2049 年。 </para>
|
||||
<para>陽曆 2001 1 24 是陰曆的 2001 1 1。</para>
|
||||
<programlisting>
|
||||
&prompt.user; <userinput>lunar 2001 1 24</userinput>
|
||||
&prompt.user; <userinput>lunar -i 2001 1 1</userinput>
|
||||
Lunar Version 2.1 (July 23, 1992)
|
||||
|
||||
Solar : 2001.1.24.0 Wednesday
|
||||
Lunar : 2001.1.1.0 ShengXiao: Snake
|
||||
GanZhi: Xin1-Si4.Geng1-Yin2.Ding1-Hai4.Geng1-Zi3
|
||||
(GanZhi Order) 8-6.7-3.4-12.7-1
|
||||
(JiaZi Cycle) 18.27.24.37
|
||||
|
||||
BaZi (8-characters) according to 'Four Column Calculation':
|
||||
Geng1-Chen2.Ji3-Chou3.Ding1-Hai4.Geng1-Zi3
|
||||
(GanZhi Order) 7-5.6-2.4-12.7-1
|
||||
(JiaZi Cycle) 17.26.24.37
|
||||
&prompt.user; <userinput>lunar -5 -i 2001 1 1</userinput>
|
||||
Lunar Version 2.1 (July 23, 1992)
|
||||
|
||||
陽歷: 2001年 1月24日 0時 星期三
|
||||
陰歷: 2001年 1月 1日子時 生肖屬蛇
|
||||
干支: 辛巳年 庚寅月 丁亥日 庚子時
|
||||
用四柱神算推算之時辰八字: 庚辰年 己丑月 丁亥日 庚子時 </programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="linux-locale">
|
||||
<title>linux_locale - linux 模擬器所需的中文 locale 資訊 [OBSOLETE]</title>
|
||||
<para>這個 port 主要是讓要使用 linux emulator 的人,也能有 locale data,
|
||||
所以經常使用 linux-* 的人最好裝一下,以剛才的經驗而言,
|
||||
安裝了 www/linux-mozilla 後,執行卻發生 locale 不支援的情況,
|
||||
造成根本沒辦法讓 xcin2.5 切換輸入法,並在 console 有警告訊息,
|
||||
在安裝後就可以切換了,不過中文還是沒辦法正確的輸入到 linux-mozilla 中。
|
||||
但是在 linux_base-7.1 之後就可以不需要 linux_locale 了,
|
||||
因為這是給 linux_base-6.2 用的,之後已經是內建的了。</para>
|
||||
<para>一點小經驗,參考看看 :)</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mkisofs">
|
||||
<title>mkisofs - 建立光碟影像檔</title>
|
||||
<para>在 FreeBSD 底下燒錄光碟有兩個步驟:</para>
|
||||
<para>1. 將所需的資料 ( 檔案,音樂或全部 ) 包裝成一些特別格式的檔案。</para>
|
||||
<para>2. 用 burncd 將這些檔案寫入光碟中。 </para>
|
||||
<para>mkisofs 就是 1. 的工具,也就是建立光碟影像檔。
|
||||
而在 ports/chinese 底下的 mkisofs 可以建立 Chinese Big5
|
||||
檔名,請使用 -J 的選項來使用它。 </para>
|
||||
<para>也可以參考這個網頁,
|
||||
<ulink url="http://www.arekore.org/cdrecord/mkisofs-NLS-CJK.html">
|
||||
mkisofs-NLS-CJK</ulink>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mkisofs -a -f -l -r -J -o ~/test.iso ~/test/</userinput>
|
||||
&prompt.root; <userinput>vnconfig vn0 test.iso</userinput>
|
||||
&prompt.root; <userinput>mount -t cd9660 /dev/vn0 /mnt/iso</userinput>
|
||||
&prompt.root; <userinput>ls /mnt/iso</userinput>
|
||||
&prompt.root; <userinput>umount /mnt/iso</userinput>
|
||||
&prompt.root; <userinput>vnconfig -u vn0</userinput>
|
||||
&prompt.root; <userinput>burncd -e -v -s 6 -f /dev/acd1c data test.iso fixate</userinput></screen>
|
||||
<para>以上的範例是把 <filename>~/test/</filename> 目錄下的所有檔案,
|
||||
建立成一個 <filename>test.iso</filename>,可以先用
|
||||
<command>du -s -h ~/test/</command> 檢察是否會超過您的光碟容量,
|
||||
然後用 <command>vnconfig</command> 來測試,在測試前,
|
||||
記得要先安裝 <application>big5fs</application>,
|
||||
並按照 <application>big5fs</application> 的要求做好準備工作,
|
||||
在搭配可以看到中文的 <command>ls</command>,
|
||||
這樣子就可以在 FreeBSD 底下燒錄中文檔案了。</para>
|
||||
<para>目前 ports 中的 mkisofs 雖然支援 nls,但是只有支援 one byte 的,
|
||||
所以並不能作中文的轉換。</para>
|
||||
<para>作者不採納 multu-byte NLS 的原因如下:</para>
|
||||
<para>
|
||||
Both solutions requiere the complete set of tables to be compiled into mkisofs.
|
||||
There was no concept of reading files instead.
|
||||
I believe that it is better to try to use libiconv instead.</para>
|
||||
<para>以下是筆者的日誌,大部分的人應該都不會感興趣的。</para>
|
||||
<para>這篇文章是我在看完 chinese/mkisofs 的 patch 寫下的日誌,
|
||||
mkisofs 目前是 cdrecord project 的一部份,cdrecord 目前在
|
||||
<filename role="package">sysutils/cdrtools</filename> 底下,
|
||||
而 mkisofs 則是在 <filename role="package">sysutils/mkisofs</filename>
|
||||
,該 port 最主要的部份就是修正 mkisofs 的 joliet 對中文的支援問題,
|
||||
patch 分成兩個部份,convert_to_unicode 和 joliet_strlenm。</para>
|
||||
<para>在 convert_to_unicode 部分,他會將所有的字作轉換,轉換成 2bytes的Unicode編碼,以常見的英文來說:</para>
|
||||
<programlisting>
|
||||
ABC -> 0A0B0C
|
||||
3bytes -> 6bytes</programlisting>
|
||||
<para>而中文的部份:</para>
|
||||
<programlisting>
|
||||
0xA4E5(文) -> big5_to_unicode -> 0x6587
|
||||
2bytes 2bytes</programlisting>
|
||||
<para>其實可以直接用 iconv 作掉整個轉換的部份。</para>
|
||||
<para>而 joliet_strlen 的部分,
|
||||
這邊是指定 joliet 所給予的 buffer size,預設全都是英文,
|
||||
所以原本 3bytes 的 ABC 會變成 6bytes 的 0A0B0C,
|
||||
但是中文的部份要修正成 2bytes 的中文出來還是 2bytes。</para>
|
||||
<para>所以我也針對現在 mkisofs 的版本作了一個 patch,
|
||||
有興趣的人可以裝 outta-port/mkisofs 或是 outta-port/cdrtools:</para>
|
||||
<para>WWW: <ulink url="http://www.fokus.gmd.de/research/cc/glone/employees/joerg.schilling/private/cdrecord.html">
|
||||
cdrecord project</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="mule-freewnn">
|
||||
<title>mule-freewnn</title>
|
||||
<para><application>MULE</application> 是
|
||||
MULtilingual Enhancement to GNU Emacs 的簡寫。
|
||||
簡單的說,就是在 <application>GNU Emacs</application>
|
||||
上加些東西,讓它可以處理多國語言
|
||||
(編碼系統)。它將多位元組(multi bytes)的編碼系統
|
||||
(encoding system)重新在內部又編一次碼,因此,一篇文章中可同時
|
||||
使用中文 (BIG5 跟 GB),日文,韓文,英文,泰文等等。 </para>
|
||||
<para>在 <application>Mule-2.3</application> 使用中文</para>
|
||||
<para>如果您已安裝了字型,您可以用 <application>mule</application>
|
||||
來輸入與顯示中文。
|
||||
大部份的字型都是 16 或 24 點的,所以用: </para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>mule -fn 8x16 &</userinput>
|
||||
&prompt.root; <userinput>mule -fn 12x24 &</userinput> </screen>
|
||||
<note><para>按 M-x load-library RETURN chinese RETURN。
|
||||
``Ctrl-]'' 用來切換輸入法。 </para></note>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="muni">
|
||||
<title>muni</title>
|
||||
<para>Muni finds the Unicode value of the 7773 Chinese characters
|
||||
listed in Matthews' Chinese-English Dictionary. </para>
|
||||
<para>WWW: <ulink url="http://www.whizkidtech.net/i18n/muni/">
|
||||
muni project</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="p5-date-chinese">
|
||||
<title>p5-Date-Chinese</title>
|
||||
<para>能經由輸入西元年得到農曆年的程式。</para>
|
||||
<programlisting>
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Date::Chinese;
|
||||
$year = yearofthe( 1999 );
|
||||
print $year; # "Year of the hare"</programlisting>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="qkmj">
|
||||
<title>qkmj - 中國的國粹:麻將</title>
|
||||
<para>您是否沒有機會和別人打麻將?是否常為了打麻將輸錢而和朋友傷和氣?
|
||||
麻將本是中國的國粹,但常久以來一直為人所垢病的一點,
|
||||
就是許多人將它拿來做為賭錢的工具。
|
||||
現在一個讓您了解自己麻將實力的機會來了。透過網路麻將,
|
||||
您可以隨時和來自各地的好手較量,
|
||||
根據自己的分數進而可知道自己的實力究竟如何。
|
||||
QKMJ 之中文名稱為網路休閒麻將,這是一個 Clinet/Server 架構,
|
||||
可以讓您在網路上和其它的使用者一起打麻將的程式。 </para>
|
||||
<para>如果是 5-CURRENT 的機器必須安裝 COMPAT4X,
|
||||
且必須設定 TERM 為 vt100,所以筆者通常都用
|
||||
<command>env TERM=vt100 qkmj</command> 來啟動,或是設定成
|
||||
alias,<command>alias qkmj 'env TERM=vt100 qkmj'</command>。</para>
|
||||
<para>使用時請打
|
||||
<command>qkmj <server_ip> <server_port></command>,
|
||||
不加後面參數代表使用原來的設定。例如:<command>qkmj</command>
|
||||
就可連到目前 QKMJ 的主要 server。</para>
|
||||
<para>如果在打入 <command>qkmj</command> 時發現如下的訊息:</para>
|
||||
<programlisting>
|
||||
Couldn't open /usr/libexec/ld.so.</programlisting>
|
||||
<para>請用如下的指令來修正 <command>ln -s /usr/local/libexec/ld.so
|
||||
/usr/libexec/ld.so</command>。</para>
|
||||
<para>WWW:
|
||||
<ulink url="ftp://ftp.csie.nctu.edu.tw/pub/CSIE/qkmj/qkmj.faq">
|
||||
qkmj faq</ulink></para>
|
||||
<figure>
|
||||
<title>qkmj snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/qkmj" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.csie.nctu.edu.tw/~sywu/">
|
||||
sywu's homepage</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,313 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.37
|
||||
-->
|
||||
|
||||
<chapter id="freebsd-desktop">
|
||||
<title>以 FreeBSD 建立中文 Desktop 的安裝指南</title>
|
||||
<para>以下是筆者自己在安裝 FreeBSD 時的作法,
|
||||
並不會適合所有人。</para>
|
||||
|
||||
<para>在建立中文 Desktop 前,請先參考
|
||||
<ulink url="http://freebsd.sinica.edu.tw/handbook/install.html">
|
||||
Installing FreeBSD</ulink> 安裝好基本的 FreeBSD 環境,
|
||||
並設定好網路卡。</para>
|
||||
|
||||
<para>一般使用者的需求是要能夠在 X Window 下使用中文環境,
|
||||
所以下面就是建立基本中文環境的做法。
|
||||
當按照下面的中文環境設定好後,就可以使用 <command>startx</command>
|
||||
開啟 <application>GNOME</application> 美化過後的
|
||||
X Window,並使用滑鼠右鍵開啟選單,先執行 <command>xcin2.5 &</command>
|
||||
後,再執行 <command>gnome-terminal</command>,這樣子即可在
|
||||
<application>gnome-terminal</application> 上進行基本的中文顯示與輸入,
|
||||
這對在 X Window 底下使用 Console 軟體已經十分足夠。</para>
|
||||
|
||||
<sect1 id="stepbystep">
|
||||
<title>輕鬆安裝FreeBSD中文桌面</title>
|
||||
<para>如果網路還算快,
|
||||
FreeBSD 桌面系統的安裝是可以在三十分鐘內完成的。</para>
|
||||
<para>在這個部分以 package 安裝的方式來進行,
|
||||
這樣子可以快速的使用 FreeBSD。
|
||||
在安裝完 FreeBSD 後,系統上應該沒有許多方便的套件,
|
||||
而就算是光碟上有一些,大部分的狀況仍然不敷使用,
|
||||
特別是本地化的套件不會放在第一片光碟中。
|
||||
雖然有第三片與第四片光碟內含許多,但時常會沒包含我們要用的,
|
||||
畢竟現在的套件已經太多,空間不足容納。
|
||||
但是目前各大學都有 mirror 完整的 packages,
|
||||
這對我們而言是個非常有利的,只要知道哪個站離你最快,
|
||||
很快的就能建立新的 FreeBSD 環境。</para>
|
||||
<para>你可以先設定 <option>PACKAGEROOT</option>,這是用來抓取套件的位置,
|
||||
筆者通常設定 <command>setenv PACKAGEROOT ftp://ftp.tw.freebsd.org</command>,
|
||||
因為這是我認為最穩定的機器,然後就可以透過 <command>pkg_add -r 套件名</command>
|
||||
來安裝套件,他會自動的到 <filename>pub/FreeBSD/ports/i386/packages-4.9-release/Latest/</filename>
|
||||
底下尋找套件,而且你不需要知道版本,只要知道套件名稱即可,
|
||||
他會自動安裝當時的最新版,中文的部分只要加上 <option>zh-</option>,
|
||||
像是 <filename>zh-xcin</filename>。</para>
|
||||
<note><para>如果要讓 <filename role="package">sysutils/portupgrade</filename>
|
||||
能夠使用,則要在 <filename>pkgtools.conf</filename> 裡面加上
|
||||
<option>ENV['PACKAGEROOT'] = 'ftp://ftp.tw.FreeBSD.org'</option>,
|
||||
並在使用 <command>portupgrade</command> 時加上 <option>-P</option> 或是
|
||||
<option>-PP</option> 來利用 packages 安裝。</para></note>
|
||||
<procedure>
|
||||
<step><para>設定 <option>PACKAGEROOT</option>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>setenv PACKAGEROOT ftp://ftp.tw.freebsd.org</userinput></screen>
|
||||
<para>在大陸設定為 <option>ftp://ftp.freebsdchina.org</option>。</para>
|
||||
<step><para>調整時區,並對時。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>tzsetup /usr/share/zoneinfo/Asia/Taipei</userinput>
|
||||
&prompt.root; <userinput>ntpdate time.stdtime.gov.tw</userinput></screen>
|
||||
<para>請參考 <link linkend="tzsetup">時區的設定</link> 一節。</para></step>
|
||||
<step><para>安裝 <filename role="package">x11/XFree86-4</filename> 與
|
||||
<filename role="package">x11/wrapper</filename>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r XFree86</userinput>
|
||||
&prompt.root; <userinput>pkg_add -r wrapper</userinput></screen>
|
||||
<para>請參考 <link linkend="xwin">中文 X Window</link> 一節設定
|
||||
<filename>XF86Config</filename>。</para></step>
|
||||
<step><para>安裝 <filename role="package">x11/gnome2</filename>
|
||||
Window Manager。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r gnome2</userinput></screen>
|
||||
<para>設定使用 startx 時啟動:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>echo exec gnome-session > ~/.xinitrc</userinput></screen>
|
||||
<para>之後就可以用 <command>startx</command> 來啟動 X 了。</para>
|
||||
<screen>&prompt.root; <userinput>startx</userinput></screen>
|
||||
<para>進去 X 後把字體改成我要的:
|
||||
<option>應用程序 -> 桌面首選項 -> 字體</option>,
|
||||
<option>應用程序字體: Bitstream Vera Sans</option>,
|
||||
<option>桌面字體: Bitstream Vera Serif</option>,
|
||||
<option>終端字體: Bitstream Vera Sans Mono</option>。</para>
|
||||
<para>請參考 <link linkend="gnome">GNOME 的中文化</link> 一節。</para></step>
|
||||
<step><para>安裝 <filename role="package">chinese/arphicttf</filename>
|
||||
文鼎繁簡中文字型。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r zh-arphicttf</userinput></screen>
|
||||
<para>接著編輯 <filename>/etc/XF86Config</filename>,
|
||||
在 <option>Section "Module"</option> 區段,
|
||||
加入 <option>Load "xtt"</option>。</para>
|
||||
<programlisting>
|
||||
Section "Module"
|
||||
:
|
||||
Load "xtt"
|
||||
EndSection</programlisting>
|
||||
<para>在 <option>Section "Files"</option> 區段,
|
||||
加入 <option>FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"</option>
|
||||
與 <option>FontPath "/usr/X11R6/lib/X11/fonts/local/"</option>。</para>
|
||||
<programlisting>
|
||||
Section "Files"
|
||||
:
|
||||
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
|
||||
FontPath "/usr/X11R6/lib/X11/fonts/local/"
|
||||
EndSection</programlisting>
|
||||
<para>請參考 <link linkend="fonts">輸出字型</link> 一節。</para></step>
|
||||
<step><para>安裝 <filename role="package">chinese/auto-tw-l10n</filename>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r zh-auto-tw-l10n</userinput></screen>
|
||||
<para>安裝完,在 <filename>/usr/local/share/skel/zh_TW.Big5/</filename>
|
||||
目錄底下會有許多的參考設定。簡體中文請另外設定。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cat /usr/local/share/skel/zh_TW.Big5/dot.cshrc >> ~/.cshrc</userinput>
|
||||
&prompt.root; <userinput>cat /usr/local/share/skel/zh_TW.Big5/dot.Xdefaults >> ~/.Xdefaults</userinput>
|
||||
&prompt.root; <userinput>cat /usr/local/share/skel/zh_TW.Big5/dot.gtkrc >> ~/.gtkrc.mine</userinput>
|
||||
</screen>
|
||||
<para>請參考 <link linkend="setlocale">中文 locale 的設定</link> 一節。</para></step>
|
||||
<step><para>中文繁體輸入安裝 <filename role="package">xcin25</filename>,
|
||||
簡體中文輸入可以安裝 <filename role="package">fcitx</filename>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r zh-xcin</userinput>
|
||||
&prompt.root; <userinput>pkg_add -r zh-fcitx</userinput></screen>
|
||||
<para>接著編輯 <filename>~/.cshrc</filename>,
|
||||
加入 <option>setenv XMODIFIERS "@im=xcin"</option> 或是
|
||||
<option>setenv XMODIFIERS "@im=fcitx"</option>,
|
||||
讓大部份軟體都可以知道您有安裝了 XIM。</para>
|
||||
<para>並且我會修改 <filename>xcinrc</filename> 的部份設定,
|
||||
先 <command>chmod 644 /usr/X11R6/etc/xcin</command> 後,
|
||||
修改其內容,把 <option>DEFAULT_IM</option> 改成
|
||||
<option>chewing</option>,並且把預設的字型大小 24 改成 16。</para>
|
||||
<para>請參考 <link linkend="view">中文的顯示與輸入</link> 一節。</para></step>
|
||||
<step><para>瀏覽器就裝 <filename role="package">www/mozilla-gtk2</filename>。
|
||||
如果安裝 <application>GNOME2</application>
|
||||
那麼這個也是預設會安裝的一部分。開啟後來改字型:
|
||||
<option>Edit -> Preferences -> Appearance -> Fonts</option>,
|
||||
<option>Fonts for: Simplified Chinese</option>,
|
||||
<option>Serif: Bitstream Vera Serif </option>,
|
||||
<option>Sans-serif: Bitstream Vera Sans </option>,
|
||||
<option>Cursive: Bitstream Vera Serif </option>,
|
||||
<option>Fantasy: Bitstream Vera Serif </option>,
|
||||
<option>Monospace: Bitstream Vera Sans Mono </option>,
|
||||
<option>Minimum font size: 12 </option>。</para>
|
||||
<para>並且到 <ulink url="http://themes.mozdev.org/">
|
||||
http://themes.mozdev.org/</ulink> 下載 <application>ORbit 3+1</application>
|
||||
,<ulink url="http://themes.mozdev.org/themes/orbit.html">
|
||||
http://themes.mozdev.org/themes/orbit.html</ulink> 的網頁中,
|
||||
可以選擇安裝模式或是檔案模式,安裝模式就是在
|
||||
<application>Mozilla</application>底下點選就可以安裝,
|
||||
檔案模式可以自行下載後,在透過 <application>Mozilla</application>
|
||||
的功能來匯入。</para>
|
||||
<para>請參考 <link linkend="mozilla">Mozilla 繁體中文語言包</link> 一節。</para></step>
|
||||
<step><para>雖然預設的 ls 能看到中文和彩色,不過我還是偏好使用
|
||||
<filename role="package">misc/gnuls</filename>。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r gnuls</userinput></screen>
|
||||
<para>安裝完後,在 <filename>~/.cshrc</filename> 增加一行
|
||||
<option>alias ls 'gnuls --color=auto --show-control-chars'</option>,
|
||||
讓 <application>gnuls</application> 的顏色和中文功能啟動。</para>
|
||||
<para>請參考 <link linkend="gnuls">gnuls - 特殊中文檔名和目錄的顯示</link> 一節。</para></step>
|
||||
<step><para>當需要遠端 telnet 輸入中文時,就會需要
|
||||
<filename role="package">chinese/telnet</filename> 這樣子的軟體。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r zh-telnet</userinput></screen>
|
||||
<para>然後在 <filename>~/.cshrc</filename> 裡面加上
|
||||
<option>alias telnet zh-telnet</option>。</para>
|
||||
<para>請參考 <link linkend="telnet">telnet 的中文問題</link> 一節。</para></step>
|
||||
<step><para>MP3 撥放器就用 <filename role="package">chinese/xmms</filename>,
|
||||
中文的曲名都可以看到。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r zh-xmms</userinput></screen>
|
||||
<para>請參考 <link linkend="xmms">xmms - mp3 播放器</link> 一節。</para></step>
|
||||
<step><para>Media Player,支援 vcd dvd DivX,安裝
|
||||
<filename role="package">multimedia/mplayer</filename>,
|
||||
中文字幕都支援。</para>
|
||||
<screen>&prompt.root; <userinput>pkg_add -r mplayer</userinput></screen>
|
||||
<para>請參考 <link linkend="mplayer">mplayer</link> 一節。</para></step>
|
||||
<step><para>PDF Reader 安裝 <filename role="package">chinese/xpdf</filename>,
|
||||
設定一下中文取代字型,就可以看到大部分的中文 PDF。</para>
|
||||
<screen>&prompt.root; <userinput>pkg_add -r zh-xpdf</userinput></screen>
|
||||
<para>請參考 <link linkend="xpdf">中文 PDF 的顯示</link> 一節。</para></step>
|
||||
<step><para>我常用的有 FTP Client 有 <command>fetch</command>,
|
||||
<filename role="package">ftp/wget</filename>,
|
||||
<filename role="package">ftp/ncftp3</filename>,
|
||||
<filename role="package">ftp/IglooFTP</filename>,
|
||||
前三個是文字介面使用的,最後一個在 X 底下,以下是安裝:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r wget</userinput>
|
||||
&prompt.root; <userinput>pkg_add -r ncftp3</userinput>
|
||||
&prompt.root; <userinput>pkg_add -r IglooFTP</userinput></screen>
|
||||
<para>由於 <application>wget</application> 的中文有點問題,
|
||||
所以目前都用 outta-port 在安裝。</para></step>
|
||||
<step><para>MSN Messeger 我使用 <filename role="package">net/gaim</filename>
|
||||
來當作我慣用的 MSN Messenger。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>pkg_add -r gaim</userinput></screen>
|
||||
<para>請參考 <link linkend="gaim">gaim - ICQ, MSN clone</link> 一節。</para></step>
|
||||
</procedure>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="set-default-font">
|
||||
<title>使用其他字型作為預設字型</title>
|
||||
<para>Last Update: 2003年 1月25日 周六 12時54分03秒 CST</para>
|
||||
<para>不得不承認現在的文鼎字型不如細明體,
|
||||
主因是系明體的內嵌小字看起來真的舒服很多,
|
||||
以下介紹將預設字型設定成細明體的方式。</para>
|
||||
<para>首先要有 <filename>mingliu.ttc</filename>,
|
||||
將該字型拷貝到 <filename>/usr/local/share/fonts/TrueType/</filename>
|
||||
下,然後用 <application>ttfm</application> 安裝該字型:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>ttfm.sh --add xttfm /usr/local/share/fonts/TrueType/mingliu.ttc</userinput>
|
||||
&prompt.root; <userinput>fc-cache -f -v /usr/X11R6/lib/X11/fonts/TrueType/</userinput></screen>
|
||||
<para>接著是根據每個軟體來修改,在 gtk1 系列的軟體,可以修改
|
||||
<filename>~/.gtkrc</filename>,
|
||||
在英文字型後,第一個加上
|
||||
<option>-DynaLab-MingLiU-medium-r-normal--16-*-*-*-c-*-big5-0,</option>
|
||||
就可以了。</para>
|
||||
<para>gtk2 系列的改 <filename>~/.fonts.conf</filename>。</para>
|
||||
<programlisting>
|
||||
<alias>
|
||||
<family>serif</family>
|
||||
<prefer>
|
||||
<family>Bitstream Vera Serif</family>
|
||||
<family>PMingLiU</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias>
|
||||
<family>sans-serif</family>
|
||||
<prefer>
|
||||
<family>Bitstream Vera Sans</family>
|
||||
<family>PMingLiU</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>Bitstream Vera Sans Mono</family>
|
||||
<family>PMingLiU</family>
|
||||
</prefer>
|
||||
</alias></programlisting>
|
||||
<para>
|
||||
<application>WindowMaker</application> 則是修改
|
||||
<filename>~/GNUstep/Defaults/WindowMaker</filename>,
|
||||
把所有包含 Font 的設定加上
|
||||
<option>,-DynaLab-MingLiU-medium-r-normal--16-*-*-*-c-*-big5-0</option>
|
||||
,這邊的 16 要根據前面 Font 的字型大小設定,設定完後,
|
||||
重開 X 就可以了。</para>
|
||||
<para>
|
||||
<application>Mozilla-gtk2</application> 修改字型可以進入選單後修改,
|
||||
Edit -> Preference -> Appearance -> Fonts,
|
||||
<option>Fonts for:</option> 選擇
|
||||
<option>Traditional Chinese</option>,然後把字型都選擇成
|
||||
<option>PMingLiU</option> 就可以了。</para>
|
||||
<para>
|
||||
<application>xpdf</application> 則是修改 <filename>/usr/X11R6/etc/xpdfrc</filename>,
|
||||
<option>displayCIDFontX Adobe-CNS1 "-dynalab-mingliu-medium-r-normal--%s-*-*-*-c-*-iso10646-1" UCS-2</option> 就可以了。</para>
|
||||
|
||||
<sect1 id="cvsup">
|
||||
<title>保持最新的 Ports Tree</title>
|
||||
<para>Last Update: 2006年 3月13日 周一 01時47分34秒 CST</para>
|
||||
<para>Contributed by &a.gslin;</para>
|
||||
<para>在安裝軟體前,最好先更新 Ports Tree,
|
||||
建議先由安裝光碟中選擇 Ports Collection 先安裝好後,
|
||||
再來更新 Ports Tree,這樣子更新的時間會比較短。</para>
|
||||
<para>接著設定好 <filename>/etc/make.conf</filename>
|
||||
(若沒有則自行建立)。</para>
|
||||
<programlisting>
|
||||
SUP_UPDATE= yes
|
||||
SUP= /usr/local/bin/cvsup
|
||||
SUPFLAGS= -g -L 2
|
||||
#
|
||||
# SUPHOST 代表要到哪台 CVSup,請改成離您比較近的 Server。
|
||||
# cvsup[1-13].tw.FreeBSD.org
|
||||
SUPHOST= cvsup.tw.FreeBSD.org
|
||||
|
||||
#
|
||||
# 如果您是用 -STABLE,請用 stable-supfile (目前的 4.X -STABLE 是 4.11,5.X -STABLE 是 5.4,6.X -STABLE 是 6.0)
|
||||
# 如果您是用 -CURRENT,請用 standard-supfile (目前的 -CURRENT 是 7.0)
|
||||
SUPFILE= /usr/share/examples/cvsup/stable-supfile
|
||||
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
|
||||
DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
|
||||
|
||||
# 國內主要的 FreeBSD distfiles mirror 站台
|
||||
MASTER_SITE_BACKUP?= \
|
||||
ftp://cvsup.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
|
||||
ftp://cvsup10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
|
||||
ftp://cvsup13.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
|
||||
ftp://cvsup2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
|
||||
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}</programlisting>
|
||||
<note>
|
||||
<para>可以安裝 <filename role="package">sysutils/fastest_cvsup</filename>
|
||||
來檢察那一個 cvsup 最適合您,安裝完後執行 <command>fastest_cvsup -c tw</command>。
|
||||
</para></note>
|
||||
<para>安裝好基本的 Ports Tree 後,安裝
|
||||
<filename role="package">net/cvsup-without-gui</filename>。</para>
|
||||
<para>接著就可以進行更新了:</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>cd /usr/ports</userinput>
|
||||
&prompt.root; <userinput>make update</userinput></screen>
|
||||
<para>WWW: <ulink url="http://ccca.nctu.edu.tw/~gslin/Documents/FreeBSD/use-cvsup.txt">
|
||||
如何用 CVSup 去更新您的 source 以及 ports</ulink></para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
||||
|
|
@ -1,476 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.60
|
||||
-->
|
||||
|
||||
<chapter id="wm">
|
||||
<title>中文視窗管理程式</title>
|
||||
<para></para>
|
||||
|
||||
<sect1 id="gnome">
|
||||
<title>GNOME 程式的中文支援</title>
|
||||
<para><application>GNOME</application> 並不是一個軟體,而是由
|
||||
GNU Project的另一項軟體計劃,而它的目標就是創造出一個完整
|
||||
而友善的桌面環境。為了達成這個目標,在
|
||||
<application>GNOME</application> 收集的工具中,
|
||||
包含了發展工具,網路工具,數學工具,還有系統管理和桌面管理的
|
||||
工具,甚至連娛樂用軟體和多媒體處理的工具都包含在它的收集之列,
|
||||
讓您的 X Window 使用起來,簡直有如虎添翼一般。</para>
|
||||
<para>但 GNOME 的好處不僅僅如此而己,現在我們在 X Windows 底下,
|
||||
當您要開啟某個檔案,您只要在 <application>GNOME</application>
|
||||
的檔案總管按二下就可以檢視它了。這原本只能在 Mac OS 或
|
||||
MS Windows 看的到的能力,現在在 <application>GNOME
|
||||
</application> 之下,在 X Windows 下也能看到。</para>
|
||||
<para><application>GNOME</application> 程式是基於
|
||||
<application>GTK+</application> 這個函式庫開發出來的,
|
||||
<application>GTK+</application>
|
||||
的國際化一直做的不錯,所以在我們的環境底下,大部分的
|
||||
<application>GNOME</application>
|
||||
程式都可以正常使用中文了。 </para>
|
||||
<para>訊息翻譯也由 <ulink url="http://i18n.linux.org.tw">
|
||||
http://i18n.linux.org.tw</ulink> 正在進行著,
|
||||
有空請多多給他們鼓勵吧。 </para>
|
||||
<para>WWW: <ulink url="http://www.gnome.org/">
|
||||
http://www.gnome.org/</ulink> </para>
|
||||
<sect2 id="gtk2">
|
||||
<title>gtk2</title>
|
||||
<para>在 gnome2.2 之後採用 xft2 & fontconfig 來設定字型,
|
||||
gtk2 的設定方式是用 <filename>~/.gtkrc-2.0</filename>,
|
||||
設定的格式與 <filename>~/.gtkrc</filename>相同,
|
||||
但是取用字型的寫法不ㄧ樣。</para>
|
||||
<programlisting>
|
||||
style "gtk-default-zh-tw" {
|
||||
font_name = "Sans 16"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-zh-tw"</programlisting>
|
||||
<para>如果要更改預設字型大小直接修改 <filename>~/.gtkrc-2.0</filename>
|
||||
就可以了,而如果是要改顯示的字型則是可以選擇
|
||||
<filename>~/.gtkrc-2.0</filename>
|
||||
或是 <filename>fonts.conf</filename>,
|
||||
而字型名稱可以從 <command>fc-list</command> 這個指令得到。</para>
|
||||
<note><para>中文字在小字的時候,某些字型使用 anti-alias 反而會變得模糊,
|
||||
gtk2 使用 Xft2,設定檔則是
|
||||
<filename>/usr/X11R6/etc/fonts/fonts.conf</filename>
|
||||
,以下的範例是關閉小於 13 點字型時的 anti-aliasing。</para>
|
||||
<programlisting>
|
||||
<match target="pattern">
|
||||
<test qual="any" name="size" compare="less">
|
||||
<int>13</int>
|
||||
</test>
|
||||
<edit name="antialias" mode="assign">
|
||||
<bool>false</bool>
|
||||
</edit>
|
||||
</match>
|
||||
</programlisting></note>
|
||||
<para>另外 gtk2 不支援 OverTheSpot,只支援 Root 及 OnTheSpot,
|
||||
可以用 gconftool-2 更改設定。如果還是不行,在輸入區按下右鍵,
|
||||
選取輸入模組 <option>XIM</option>。</para>
|
||||
</sect2>
|
||||
<sect2 id="gtk1">
|
||||
<title>gtk1</title>
|
||||
<para>以下是 gtk1 的設定方式,設定檔的內容如下:
|
||||
(應該會在 <filename>
|
||||
/usr/X11R6/share/themes/Default/gtk/gtkrc.zh_TW.Big5</filename> ) </para>
|
||||
<programlisting>
|
||||
# $(gtkconfigdir)/gtkrc.zh_TW
|
||||
#
|
||||
# This file defines the fontsets for Chinese language (ch) using
|
||||
# the traditional chinese Big5 encoding as used in Taiwan (TW)
|
||||
#
|
||||
# 1999, Pablo Saratxaga <pablo mandrakesoft.com>
|
||||
#
|
||||
|
||||
# IMPORTANT NOTE: The name of this file *MUST* be "gtkrc.zh_TW.big5"
|
||||
# the lowercasing of "big5" is done on purpose, if you change it it won't work
|
||||
|
||||
style "gtk-default-zh-tw" {
|
||||
fontset = "-adobe-helvetica-medium-r-normal--16-*-*-*-*-*-iso8859-1,\
|
||||
-taipei-*-medium-r-normal--*-*-*-*-*-*-big5-0,\
|
||||
-*-*-medium-r-normal--16-*-*-*-*-*-big5-0,*-r-*"
|
||||
}
|
||||
class "GtkWidget" style "gtk-default-zh-tw" </programlisting>
|
||||
<para>這個檔案裡面設定了 zh_TW.Big5 環境要用到的字型集,
|
||||
上面的設定表示在使用 zh_TW.Big5 環境的時候會需要用到兩種字體,
|
||||
一個是 iso8859-* 的字體,用來顯示英文字,一種是 big5-0 的字體,
|
||||
用來顯示 BIG5 中文。讀者可以把這個設定檔複製一份到
|
||||
<filename>~/.gtkrc</filename>,更改裡面的設定,
|
||||
就可以在 <application>GNOME</application>
|
||||
環境底下使用自己喜歡的字體了。 </para>
|
||||
<screen>&prompt.root; <userinput>cp /usr/X11R6/share/themes/Default/gtk/gtkrc.zh_TW.Big5 ~/.gtkrc</userinput></screen>
|
||||
<!-- <para>或是將 gtkrc.zh_TW.Big5 拷貝成 gtkrc.zh_TW.big5 也是可以的。</para>-->
|
||||
<para>這是筆者偷懶的 <filename>~/.gtkrc</filename> 範例</para>
|
||||
<programlisting>
|
||||
style "default" {
|
||||
fontset = "8x16,kc15f,-*-16-*-big5-0"
|
||||
}
|
||||
widget_class "*" style "default"</programlisting>
|
||||
<note><para>如果是在 GNOME2 底下使用 gtk1 的程式,
|
||||
要改成修改 <filename>~/.gtkrc.mine</filename>。</para></note>
|
||||
<para>WWW: <ulink url="http://www.linpus.com.tw/manual/gnome/index.html">
|
||||
GNOME 中文使用手冊</ulink> </para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="nautilus">
|
||||
<title>Nautilus 中文字變成 ???</title>
|
||||
<para>首先要設定好 <filename>~/.gtkrc</filename>,
|
||||
這樣子介面的部份就會是中文的,可是內容的部份還需要修正,
|
||||
開啟軟體後:</para>
|
||||
<programlisting>
|
||||
偏好設定 -> 編輯偏好設定 -> 外觀 -> [取消] 使用平滑的圖像</programlisting>
|
||||
<figure>
|
||||
<title>nautilus snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/nautilus" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>Contributed by mingchi@bbs.sayya.org</para>
|
||||
<para>Q2: 要建立中文新檔或目錄時他用utf8來編碼,
|
||||
與以前的Big5的檔案系統不和,我該如何把他設成也是用
|
||||
Big5碼來建立新的檔案或資料夾?</para>
|
||||
<para>A2: glib與gtk2以後,對於檔案命名都是用utf8編碼,
|
||||
所以用Nautilus新增中文檔名都是用utf8編碼。解決方式為
|
||||
在自己home底下編輯 <filename>~/.gnomerc</filename>
|
||||
加入 <option>export G_BROKEN_FILENAMES=1</option>
|
||||
那他就用您預設的locale LANG 與 LC_ALL的變數作編碼囉。</para>
|
||||
<para>For more detail <ulink url="http://www.gtk.org/gtk-2.2.0-notes.html">
|
||||
GTK+-2.2 Specific Notes</ulink></para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="enlightenment">
|
||||
<title>Enlightenment 的中文化</title>
|
||||
<para>
|
||||
<application>Enlightenment</application> 的中文化雖然不是利用 po
|
||||
檔翻譯,不過中文選單只要經過如下的 patch 後就應該沒問題了,
|
||||
不過在 &a.vanilla; 的大力幫忙下,預設的 themes 已經都中文化好了,
|
||||
只是如果下載新的 themes ,就必須自行做 patch 的部分。 </para>
|
||||
<para>安裝 <filename role="package">x11-wm/enlightenment</filename>。</para>
|
||||
<para>選單的設定檔在
|
||||
<filename>/usr/X11R6/share/enlightenment/config</filename>,
|
||||
如果想中文化選單可以自己試試看。</para>
|
||||
<para>要 <application>Enlightenment</application> 的中文化,
|
||||
只要 theme 裡面的字型設定正確就可以了。大部分下載的 theme
|
||||
都只有設定 iso8859-1 的字型,還要在後面加上 big5-0 的字型,
|
||||
E 的程式本體 "基本上" 不做任何字型設定,
|
||||
任何字型都是從 theme 裡面定義的。</para>
|
||||
<para>在 theme 的 __NORMAL 部分都是字型設定,
|
||||
但這些字型設定是散在各個設定檔裡面。
|
||||
所幸,textclasses.cfg 就是讓您覆蓋用的,現在的做法就是改成 fontset
|
||||
的樣子就可以用了。例如原本的字串是:</para>
|
||||
<programlisting>
|
||||
__NORMAL "-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*"</programlisting>
|
||||
<para>要改成如下:</para>
|
||||
<programlisting>
|
||||
__NORMAL "-*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*,-*-bold-r-*-12-*"</programlisting>
|
||||
<para>只要記得前面是 -bold-r- 就改成 -*-bold-r-*-12-*,
|
||||
-medium-r- 就改成 -*-medium-r-*-12-*,
|
||||
這樣子出來的字型才會比較相近。</para>
|
||||
<para>上述的方法有一個特例,就是 E 有個特異功能。
|
||||
不用 Xtt server 就可以 show
|
||||
ttf 字型。而它的 __NORMAL 可以吃的字型有兩種。一種是 X
|
||||
裡面設定好的字型。另一種是放在 theme 裡面的 *.ttf。
|
||||
([theme name]/ttfonts 裡面)</para>
|
||||
<para>
|
||||
E 目前還不能夠把 "跟著 theme 來的 ttf" 和 "X 環境的任何字型"
|
||||
混在一起寫成 fontset 的型式。</para>
|
||||
<para>WWW: <ulink url="http://www.enlightenment.org/">
|
||||
http://www.enlightenment.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="kde">
|
||||
<title>KDE 的中文化</title>
|
||||
<para><application>KDE</application>, The K Desktop Environment
|
||||
這套使用環境,包含了三個工作區域。位於螢幕下方的panel,
|
||||
是用來開啟應用程式以及切換不同的虛擬桌面的。它有一個類似
|
||||
MS-Windows 中的開始按鈕(Application Starter),是一個大K
|
||||
的圖案,按下它就會顯示可以執行的應用程式。螢幕左上角的
|
||||
taskbar,是用來切換跟管理目前正在跑的應用程式的。而
|
||||
desktop 本身,可以用來放置檔案或是資料夾,
|
||||
<application>KDE</application> 提供數個虛擬桌面,按下在
|
||||
panel 的按鈕可以切換他們。 </para>
|
||||
<para><application>KDE</application> 有著很大的彈性,
|
||||
可以讓我們很容易地設定成習慣的使用方式,就拿 KDE Control
|
||||
Center 來說吧,我們可以調整有關於 Applications(桌面管理以及
|
||||
panel 的各項設定)、Desktop(背景圖、顏色、螢幕保護、字形和語言)、
|
||||
Information(記憶體和CPU的使用率)、Input Device(鍵盤和滑鼠)、
|
||||
Network(網路相關)、Sound(事件音效)以及Windows的各類模組(modules)
|
||||
的設定。 </para>
|
||||
<para><application>KDE</application> 在中文化的方面做的很不錯了,在
|
||||
<application>KDE</application> 中大部分的軟體都支援
|
||||
XIM ,一下子多了很多好用且可以輸入中文的軟體,
|
||||
而且畫面的美觀是這次改變的重點之一,巫師好像也成為
|
||||
<application>KDE</application> 象徵,
|
||||
真的建議有空試試看這一套軟體。
|
||||
訊息翻譯也由 <ulink url="http://i18n.linux.org.tw">
|
||||
http://i18n.linux.org.tw</ulink> 正在進行著,有空請多多給他們
|
||||
鼓勵吧。 </para>
|
||||
<para>KDE WWW: <ulink url="http://www.kde.org/">
|
||||
http://www.kde.org/</ulink></para>
|
||||
<para>這是 Taiwan <application>KDE</application> Users' Group
|
||||
<ulink url="http://kde.linux.org.tw/">http://kde.linux.org.tw/</ulink>。</para>
|
||||
|
||||
<sect2 id="kde1">
|
||||
<title>KDE1 [OBSOLETE]</title>
|
||||
<para>Last Update: 2003年 1月19日 周日 08時18分25秒 CST</para>
|
||||
<para>這邊有個進入 <application>KDE</application> 會比較快的小秘訣。
|
||||
修改 <filename>~/.qti18nrc</filename>:</para>
|
||||
<programlisting>
|
||||
Ariel -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Andale -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Georgia -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Times -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Trebuc -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Verdana -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Courier -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
Helvetica -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
kai -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
ming -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0
|
||||
* -*-ming-medium-r-normal--*-*-*-*-c-*-big5-0</programlisting>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="kde2">
|
||||
<title>KDE2 [OBSOLETE]</title>
|
||||
<para>Last Update: 2003年 1月19日 周日 08時18分25秒 CST</para>
|
||||
<para>安裝 <filename role="package">x11/kde2</filename>。</para>
|
||||
<note><para>記得安裝 <filename>chinese/arphicttf</filename>,
|
||||
要不然設定出來的字還都會是問號。</para> </note>
|
||||
<para>如果沒有辦法輸入中文的話,用命令列模式試試加上
|
||||
<option>-im xcin</option>
|
||||
,例如 <command>kword -im xcin</command>。</para>
|
||||
<para>簡單的中文化設定:</para>
|
||||
<para>
|
||||
先開啟 <quote>控制中心(Control Center)</quote>,
|
||||
<quote>個人化(Personalization)</quote>,
|
||||
<quote>國家及語言(Country & Language)</quote>,
|
||||
設定成 <quote>台灣(tw)</quote>,
|
||||
<quote>繁體中文(zh_TW.Big5)</quote>,<quote>big5-0</quote>。 </para>
|
||||
<para>
|
||||
經過這樣的設定之後,原則上,<application>KDE2</application>
|
||||
就有完整的中文支援了。 </para>
|
||||
<para>筆者的 <application>KDE</application> + Anti-Alias 安裝過程:</para>
|
||||
<para>1. 安裝 x11/XFree86-4,chinese/arphicttf,x11/kde2,
|
||||
chinese/kde2-i18n。</para>
|
||||
<para>2. 編輯 <filename>/etc/X11/XF86Config</filename>,
|
||||
將 <option>load "freetype"</option> 註解,加入
|
||||
<option>load "xtt"</option>,並在 FontPath 區段最前面加入
|
||||
<option>/usr/X11R6/lib/X11/fonts/TrueType</option>。</para>
|
||||
<para>3. 編輯 <filename>~/.xftconfig</filename>,加入:</para>
|
||||
<programlisting>
|
||||
dir "/usr/X11R6/lib/X11/fonts/TrueType"
|
||||
# Danny:
|
||||
# set the AA for different fonts
|
||||
#
|
||||
# most TT fonts do not need to be aliased between
|
||||
# 8 and 15 points, although this might be a matter of taste.
|
||||
match
|
||||
any size > 8
|
||||
any size < 15
|
||||
edit
|
||||
antialias = false;</programlisting>
|
||||
<para>4. 編輯 <filename>~/.xinitrc</filename>,在
|
||||
<option>startkde</option> 前加入
|
||||
<option>export QT_XFT=true</option>。</para>
|
||||
<para>5. 在 <option>控制中心(Control Center)</option> 改
|
||||
<option>外表 & 感覺(Look & Feel)</option> 中的
|
||||
<option>字型(Fonts)</option>,將
|
||||
<option>在字型與圖示上使用反鋸齒的平滑潤飾
|
||||
(Use Anti-Alising for fonts and icons)</option> 勾選
|
||||
;或是編輯 <filename>~/.kde/share/config/kdeglobals</filename>
|
||||
在 <option>[KDE]</option> 區段,修改 <option>AntiAliasing=true
|
||||
</option>。</para>
|
||||
<para>6. 在 <option>控制中心(Control Center)</option> 的
|
||||
<option>個人化(Personalization)</option> 的 <option>
|
||||
國家及語言(Country & Language)</option>
|
||||
設定成 <option>台灣(tw)</option>
|
||||
,<option>繁體中文(zh_TW.Big5)</option>,<option>big5-0</option>;
|
||||
或是編輯 <filename>~/.kde/share/config/kdeglobals</filename>
|
||||
在 <option>[Locale]</option> 區段,修改
|
||||
<option>Charset=big5-0</option>,<option>Country=tw</option>,
|
||||
<option>Language=zh_TW.Big5</option>。</para>
|
||||
<para>7. 重新進入 <application>KDE</application>。</para>
|
||||
<para>WWW: <ulink url="http://www.linuxdoc.org/HOWTO/mini/FDU/index.html">
|
||||
XFree86 Font De-uglification HOWTO</ulink></para>
|
||||
<para>KDE2 的替代字型(fontguess):</para>
|
||||
<para>
|
||||
在 KDE2 中修改 <filename>~/.fontguess</filename>,使 qt lib
|
||||
在選擇替代字型時能正確無誤。</para>
|
||||
<programlisting>
|
||||
[big5-0][gb2312.1980-0][ksc5601.1987-0]
|
||||
helvetica ming ming gulim
|
||||
times ming ming batang
|
||||
courier ming ming dotum
|
||||
utopia ming ming gulim
|
||||
clean ming ming gulim
|
||||
ming helvetica helvetica helvetica
|
||||
kai helvetica helvetica helvetica </programlisting>
|
||||
<para>WWW: <ulink url="http://www.mizi.com/kde/doc/fontguess/">
|
||||
To support multibyte in KDE 2.0 applications.</ulink></para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="kde3">
|
||||
<title>KDE3</title>
|
||||
<para>Contributed by EricCheng</para>
|
||||
<para>Last Update: 2003年 1月19日 周日 08時18分25秒 CST</para>
|
||||
<para>安裝 <filename role="package">x11/kde3</filename>。</para>
|
||||
<para>安裝區域化訊息 <filename role="package">x11/kde3-zh_TW</filename>。</para>
|
||||
<para>KDE3 的替代字型 (qtconfig):</para>
|
||||
<para>用 qtconfig -> Fonts -> Font Substitution。
|
||||
選一個英文字型,例如 Times New Roman [Xft]...
|
||||
Xft 代表是 Xft 的 render,
|
||||
如果與 /usr/X11R6/lib/X11/XftConfig
|
||||
或 ~/.xftconfig 沒有相左的話就會有 AA。</para>
|
||||
<para>接著 Select substitute Family 選 PMingliu [Xft],Add。
|
||||
高興的話可以選擇 SimSun 或是 SimHei,
|
||||
再加選一個 Bitstream Cyberbit 做 fallback。
|
||||
SimSun 和 SimHei 的特性是只有半形字有做 hinting,
|
||||
全形字沒有。在很多情況下這樣反而比較好看,
|
||||
缺點是半形字是 Fixed width, 字距太大有點醜。
|
||||
這樣設好之後到 Konqueror 的 Appearance -> Font 地方把
|
||||
Serif 字型調成剛剛設的 Times New Roman [Xft],
|
||||
至於其他的 Sans Serif 可以調成 Verdana,效果很好,
|
||||
自然也要在 qtconfig 中設定 Font Substitution。
|
||||
Sans Serif 是沒有襯線的字型,
|
||||
我以為中文的 equivalent 是黑體一類的字型,
|
||||
所以可以加入 SimHei 當作中文的 Sans Serif 字型,
|
||||
Serif 的襯線字型就要用 PMingLiU 一類的字。</para>
|
||||
<para>這樣做的意思是說,當使用 Qt3 的程式被設定為使用
|
||||
Times New Roman [Xft] 來畫字的時候,
|
||||
一旦遇到了 Times New Roman 沒有 cover 到的字元時
|
||||
(如中文字) 就會去找第一個 Substituion Font 來看看有沒有,
|
||||
如果沒有再往下找,一直到找到為止。
|
||||
所以可以對各種不同語系分別設定不同的 Substitution Font,
|
||||
來達到各取所長的效果。</para>
|
||||
<figure>
|
||||
<title>konq_3_1 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konq_3_1" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>注意標題列我是用 Verdana/SimHei,
|
||||
內文的字則是被設定為 Times New Roman/MingLiu。</para>
|
||||
<figure>
|
||||
<title>konq_3_2 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konq_3_2" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>Font Substitution: 用 PMingLiU 畫日文漢字,再用 Cyberbit 畫假名,
|
||||
英文仍是用 Times New Roman。
|
||||
但好像是因為 PMingLiU 的先天 coverage 不夠大,
|
||||
導致有些日本寫法的漢字沒有出來。設成其他的應該不錯。</para>
|
||||
<para>MS 的 Fonts 都花了很多心思在 Hinting 上面,
|
||||
所以小字的 AA 或 ~AA 顯示效果都很棒。
|
||||
用 Times New Roman 看英文文章 (有人統計過是最易閱讀的字體)
|
||||
很舒服啊!但如果是斜體還有大量鋸齒就看得很累了。</para>
|
||||
<figure>
|
||||
<title>konq_3_3 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konq_3_3" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>QT_XFT 是給 QT 2.x 用的,Qt3.x 這個選項就不再有用了。<para>
|
||||
<para>arphic 的字型有另一個問題是,有些字的寫法不是正確的
|
||||
"正體中文" 寫法</para>
|
||||
<para>像是『角』的裡面是穿出來的。所以叫做文鼎細『上海』宋。
|
||||
SimSun 以及 SimHei 也是同樣的道理(大陸做的),
|
||||
像是錯誤的誤右邊是口天吳,但是其餘的字因為沒有不當的 hinting,
|
||||
所以整體還是很好看。</para>
|
||||
<para>小字的時候有 Anti-Aliasing 不如沒有 Anti-Aliasing 的問題,
|
||||
那應該是不當的 hinting 所致。像是 Verdana 一類小字的 AA 就非常好看啊。
|
||||
</para>
|
||||
<figure>
|
||||
<title>kfont_3_1 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/kfont_3_1" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>Fixed 的 Font 我喜歡用 MSung Light TC,
|
||||
因為不但是 Unicode 而且半形很好看。</para>
|
||||
<figure>
|
||||
<title>konq_3_4 snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/konq_3_4" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>另外,Keith Packard 的 FontConfig 也出來了,
|
||||
但還沒空研究怎麼用就是了。</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="windowmaker">
|
||||
<title>WindowMaker 的中文化</title>
|
||||
<para><application>WindowMaker</application> 在中文化的方面做的很不錯了,
|
||||
目前已經有 I18N 的套件了,介面大部分已經中文化了。這都是仰賴
|
||||
I18N 的成果。 </para>
|
||||
<para>安裝 <filename role="package">x11-wm/windowmaker</filename>。</para>
|
||||
<para>中文標題列的問題可以檢查以下的設定,不過筆者在 0.65.1_1 版本時
|
||||
,完全不需要修改就已經可以在選單與標題看到中文:</para>
|
||||
<para>1. 檢查 <filename>~/GNUStep/Defaults/WMGLOBAL</filename> 檔,
|
||||
如果沒有就自己建立一個內容如下:</para>
|
||||
<programlisting>
|
||||
{
|
||||
MultiByteText = YES;
|
||||
}</programlisting>
|
||||
<para>2. 確認中文字型,編輯 <filename>~/GNUStep/Defaults/WindowMaker
|
||||
</filename>,修改以下選項:</para>
|
||||
<programlisting>
|
||||
MultiByteText = YES;
|
||||
WindowTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,
|
||||
-*-ming-bold-r-normal--12-*-*-*-*-*-big5-0";
|
||||
MenuTitleFont = "-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*,
|
||||
-*-ming-bold-r-normal--12-*-*-*-*-*-big5-0";
|
||||
IconTitleFont = "-*-helvetica-medium-r-normal-*-8-*-*-*-*-*-*-*,
|
||||
-*-ming-medium-r-normal--8-*-*-*-*-*-big5-0";
|
||||
ClipTitleFont = "-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*,
|
||||
-*-ming-medium-r-normal--10-*-*-*-*-*-big5-0";</programlisting>
|
||||
<para>以上只是個例子,當然必須確認有無相對字型。</para>
|
||||
<para>重新啟動 WindowMaker,用 <command>rxvt -T "中文顯示" &</command>
|
||||
測試一下。 </para>
|
||||
<figure>
|
||||
<title>windowmaker snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/windowmaker" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
<para>WWW: <ulink url="http://www.windowmaker.org/">
|
||||
http://www.windowmaker.org/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="sawfish">
|
||||
<title>Sawfish 的中文化</title>
|
||||
<para><application>Sawfish</application> 在中文化的方面做的很不錯了,
|
||||
目前已經有 I18N 的套件了,
|
||||
介面大部分已經中文化了。這都是仰賴 I18N 的成果。 </para>
|
||||
<para>安裝 <filename role="package">x11-wm/sawfish</filename>。</para>
|
||||
<para>WWW: <ulink url="http://sawmill.sourceforge.net/">
|
||||
http://sawmill.sourceforge.net/</ulink> </para>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,399 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
Original revision: 1.42
|
||||
-->
|
||||
|
||||
<chapter id="xwin">
|
||||
<title>中文 X Window</title>
|
||||
<para>
|
||||
X Window 系統是 UNIX 下強而有力的圖形環境。XFree86 由 MIT X
|
||||
Window 系統 X11R6 改版而來,它是免費的。 </para>
|
||||
<para>完整中文化 X Window System</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>中文的訊息:由 locale messages 解決</para></listitem>
|
||||
<listitem><para>中文的顯示:由 I18N 解決</para></listitem>
|
||||
<listitem><para>中文的輸入:由 xcin 解決</para></listitem>
|
||||
<listitem><para>中文的列印:由 gscjk 解決</para></listitem>
|
||||
<listitem><para>中文的處理:由系統底層的 C Library(libc) 與 X Library
|
||||
的 locale 環境與 I18N 標準以及軟體的配合解決</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>建立 I18N 的環境</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>安裝中文字型</para></listitem>
|
||||
<listitem><para>設定 Shell locale 環境</para></listitem>
|
||||
<listitem><para>安裝 XIM 中文輸入程式</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>
|
||||
基本上只要安裝完 X Window 後,再安裝中文字型,
|
||||
這樣子就可以看到 X Window 的中文了,而再安裝 xcin2.5 就可以輸入中文,
|
||||
剩下的就選自己所偏好的軟體來安裝囉。</para>
|
||||
|
||||
<sect1 id="xfree86-4">
|
||||
<title>XFree86-4</title>
|
||||
<para>安裝 <filename role="package">x11/XFree86-4</filename>。</para>
|
||||
<para>
|
||||
先用 <command>XFree86 -configure</command> 產生
|
||||
<filename>XF86Config.new</filename>,然後用
|
||||
<command>XFree86 -xf86config XF86Config.new</command>
|
||||
來測試這個檔案能不能正常的運作,如果可以的話,就
|
||||
<command>mv XF86Config.new /etc/X11/XF86config</command>,
|
||||
然後依照以下的方式繼續做下去。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>XFree86 -configure</userinput>
|
||||
&prompt.root; <userinput>mv XF86Config.new /etc/XF86Config</userinput></screen>
|
||||
<para>
|
||||
由於筆者通常使用三鍵滑鼠,所以會設定一下,
|
||||
接著編輯 <filename>/etc/XF86Config</filename>,
|
||||
在 <option>Section "InputDevice"</option> 區段,
|
||||
加入 <option>Option "ZAxisMapping" "4 5"</option>。</para>
|
||||
<programlisting>
|
||||
Section "InputDevice"
|
||||
Identifier "Mouse0"
|
||||
Driver "mouse"
|
||||
Option "Protocol" "MouseSystems"
|
||||
Option "Device" "/dev/sysmouse"
|
||||
Option "ZAxisMapping" "4 5"
|
||||
EndSection</programlisting>
|
||||
<para>
|
||||
通常都需要指定 HorizSync 和 VertSync 才能讓解析度設定的高一點,
|
||||
在 <option>Section "Monitor"</option> 區段,
|
||||
加入 <option>HorizSync 31.5 - 57.0</option> 與
|
||||
<option>VertRefresh 50.0 - 100.0</option>。</para>
|
||||
<programlisting>
|
||||
Section "Monitor"
|
||||
Identifier "Monitor0"
|
||||
VendorName "Monitor Vendor"
|
||||
ModelName "Monitor Model"
|
||||
HorizSync 31.5 - 57.0
|
||||
VertRefresh 50.0 - 100.0
|
||||
EndSection</programlisting>
|
||||
<para>
|
||||
我通常都用 16bpp 和 1024x768 的螢幕,
|
||||
在 <option>Section "Screen"</option> 區段,
|
||||
加入 <option>DefaultDepth 16</option>,並在
|
||||
<option>SubSection "Display"</option> 中,
|
||||
<option>Depth 16</option> 的地方加上
|
||||
<option>Modes "1024x768"</option>。</para>
|
||||
<programlisting>
|
||||
Section "Screen"
|
||||
Identifier "Screen0"
|
||||
Device "Card0"
|
||||
Monitor "Monitor0"
|
||||
DefaultDepth 16
|
||||
SubSection "Display"
|
||||
Depth 16
|
||||
Modes "1024x768"
|
||||
EndSubSection
|
||||
EndSection</programlisting>
|
||||
<para>
|
||||
WWW: <ulink url="http://www.xfree86.org/">
|
||||
http://www.xfree86.org/</ulink></para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="using-font">
|
||||
<title>使用字型</title>
|
||||
<para>要在 X 底下看中文,就必須先設定好你要的字型,
|
||||
目前 X 取用字型主要有兩種方式,
|
||||
一種是傳統的 X11 Core Font,
|
||||
要使用 TrueType 字型,就要利用 X 內建的 freetype 模組或是
|
||||
<link linkend="xtt">xtt</link> 模組來讀取字型,
|
||||
或是直接取用 Font Server 的字型,
|
||||
另一種則是目前流行的
|
||||
<link linkend="fontconfig">fontconfig</link>。</para>
|
||||
<para>通常筆者都會同時設定這兩種字型取用的方式,
|
||||
雖然 fontconfig 在 KDE3 與 GNOME2 廣泛的被使用,
|
||||
但是仍然有許多軟體只支援 X11 Core Font 的取用方式,
|
||||
兩者都加以設定可以避免許多問題,
|
||||
如果確定您所使用的所有軟體都支援 fontconfig,
|
||||
那麼只設定 fontconfig 也是可以的。</para>
|
||||
<para>WWW: <ulink url="http://www.xfree86.org/~dawes/4.3.0/fonts.html">
|
||||
Fonts in XFree86</ulink></para>
|
||||
<para>Hinting 是字型額外的資訊,他告訴 Render 該如何處理向量字型的縮放,
|
||||
使得小字的時候能夠好看,但是 Hinting 是非常費時費力的工作,
|
||||
有良好 Hinting 的字型不多。</para>
|
||||
<para>由於 TrueType 的 hinting 有專利,freetype 提供了 autohint,
|
||||
但是反而在中文字上容易造成反效果。</para>
|
||||
<para>Anti-alias 把未滿一格的部分用灰階補點。</para>
|
||||
<sect2 id="xlfd">
|
||||
<title>X11 Core Font - XLFD</title>
|
||||
<para>Last Update: 2003年 1月20日 周一 10時25分06秒 CST</para>
|
||||
<para>X11 Core Font 以 XLFD 的格式來讓選擇字型,以下稍微介紹一下:</para>
|
||||
<programlisting>
|
||||
-kc-fixed-medium-r-normal-*-16-160-72-72-c-160-big5-0</programlisting>
|
||||
<para>廠商名稱(Foundry):字型提供廠商,如 Arphic(文鼎)、kc(國喬)。</para>
|
||||
<para>種類(Family):所屬的類型。</para>
|
||||
<para>粗細度(Weight):粗細程度,如 medium(適中)、bold(粗體)。</para>
|
||||
<para>傾斜度(Slant):傾斜程度,如 r(不傾斜)、o(傾斜)、
|
||||
i(傾斜並且具有較奇特變化)。</para>
|
||||
<para>寬度(Setwidth):如 normal(正常)、condensed(最窄)、
|
||||
semicondensed(稍窄)。</para>
|
||||
<para>附加型式(Add Style):額外的格式,如 sans(無)、medium(適中)。
|
||||
目前大部分字體均已不用此欄位。</para>
|
||||
<para>像素大小(Pixels):用像素來表示字體大小。</para>
|
||||
<para>點數大小(Points):用點數來表示字體大小。10 個點數等於 1 個像素。</para>
|
||||
<para>水平解析度(Resolution X):每英吋的點數,如 72、75、100。</para>
|
||||
<para>垂直解析度(Resolution Y):每英吋的點數,如 72、75、100。</para>
|
||||
<para>字距(Spacing):間隔,如 Proportional(依比例大小)、
|
||||
Monospace(等寬字)、
|
||||
Charcell(等寬等高字)。</para>
|
||||
<para>平均寬度(Average Width):以點數為單位。</para>
|
||||
<para>字型集(Character Registry and Charset Encoding):如 big5-0、iso8859-1。</para>
|
||||
<para>但是 X11 Core Font 在反鋸齒上的支援不佳、
|
||||
使用 CJK TrueType 的效率不好,
|
||||
特別是目前常用的 Unicode 字型在效率和記憶體的使用都會是很大的問題,
|
||||
因此我們需要較現代化的系統 Xft/fontconfig。</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="xtt">
|
||||
<title>xtt Module</title>
|
||||
<para>要使用 xtt Module 必須修改 <filename>XF86Config</filename>,
|
||||
幫他加上新的 FontPath,因為 ports 會將中文TrueType安裝到
|
||||
<filename>/usr/X11R6/lib/X11/fonts/TrueType/</filename>,
|
||||
而且把中文PCF 安裝到
|
||||
<filename>/usr/X11R6/lib/X11/fonts/local/</filename>:</para>
|
||||
<programlisting>
|
||||
Section "Files"
|
||||
:
|
||||
:
|
||||
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
|
||||
FontPath "/usr/X11R6/lib/X11/fonts/local/"
|
||||
EndSection</programlisting>
|
||||
<para>以及讓 X 去使用 xtt 模組,
|
||||
如果在模組區發現已經有設定 <option>Load "freetype"</option>,
|
||||
請將該行刪除,因為這兩個模組是互斥的:</para>
|
||||
<programlisting>
|
||||
Section "Module"
|
||||
:
|
||||
:
|
||||
Load "xtt"
|
||||
EndSection</programlisting>
|
||||
<para>最後再透過 <link linkend="ttfm">ttfm</link>
|
||||
來安裝新字體就可以了。</para>
|
||||
<para>是不是一定要 xtt 模組才能使用中文 TrueType?答案不是。
|
||||
freetype 模組也可以用來處理中文,但是兩者只能選一個,
|
||||
而 xtt 是專為 CJKV 字型而設計產生的 TrueType 處理模組,
|
||||
其中 TTCap 選項所提供的粗體、斜體、粗斜體,
|
||||
以及其他功能是中文 TrueType 所不能或缺的。</para>
|
||||
<para>對 TTCap 而言,他的語法是擴充 fonts.dir 來提供更多的選項,例如:</para>
|
||||
<programlisting>
|
||||
ds=y:ai=0.3:bsmi00lp.ttf -Arphic-AR PL Mingti2L Big5-bold-i-normal--0-0-0-0-c-0-iso10646-1</programlisting>
|
||||
<para>最前面的 <option>ds=y:ai=0.3:</option> 就是 X-TT 擴充的部份。
|
||||
在這個例子中,文鼎明體的名稱是 bsmi00lp.ttf,
|
||||
<option>ds=y</option>(Double Strike) 使用粗體,
|
||||
<option>ai=0.3</option>(Automatic Italic) 使用斜體,
|
||||
所以相對應的產生 <option>-bold-i-</option> 的文鼎明體粗斜體字型。
|
||||
另外,最後面的 iso10646-1 就是 Unicode 字型,
|
||||
目前文鼎字型在這個部分的支持並不是很好。</para>
|
||||
<para>常用的還有 <option>fn=INTEGER</option> 來指定
|
||||
TrueType Collection(.ttc) 檔案的 face 號碼,
|
||||
像是目前處理 mingliu 就是跳過固定寬的細明體,
|
||||
而改採用直接指定變動寬的新細明體 <option>fn=1</option>。</para>
|
||||
<para>如果使用 freetype 模組,可以透過
|
||||
<filename role="package">x11-fonts/ttmkfdir</filename>
|
||||
來產生簡單的 fonts.dir 和用 <command>mkfontdir -e</command>
|
||||
來產生 encodings.dir。</para>
|
||||
<para>WWW: <ulink url="http://x-tt.sourceforge.jp/">
|
||||
http://x-tt.sourceforge.jp/</ulink></para>
|
||||
</sect2>
|
||||
<sect2 id="fontconfig">
|
||||
<title>fontconfig</title>
|
||||
<para>Fontconfig 提供 font matching 的機制,
|
||||
讓使用的程式不必自己實作字型選取的方法,
|
||||
應用程式利用 Fontconfig 所得到的字型名稱去畫字。</para>
|
||||
<para>fontconfig 安裝完後的設定檔在
|
||||
<filename>/usr/X11R6/etc/fonts/fonts.conf</filename>,
|
||||
它是個 xml 格式的檔案,一般不建議直接更改它,如果要加東西則是另外寫在
|
||||
<filename>~/.fonts.conf</filename>。</para>
|
||||
<para>使用 fontconfig 只需要將字型檔拷貝到 <filename>fonts.conf</filename>
|
||||
所指定的目錄下(<dir>/usr/X11R6/lib/X11/fonts</dir>),
|
||||
然後執行 <command>fc-cache -f -v</command> 來建立字型資料庫,
|
||||
也可以用 <command>fc-list</command> 來取得已經建立的資料。</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>fc-cache -f -v</userinput>
|
||||
:
|
||||
fc-cache: "/usr/X11R6/lib/X11/fonts/TrueType": caching, 8 fonts, 0 dirs
|
||||
:
|
||||
fc-cache: "/root/.fonts": no such directory, skipping
|
||||
fc-cache: succeeded
|
||||
&prompt.root; <userinput>fc-list | grep Big5</userinput>
|
||||
AR PL KaitiM Big5:style=Regular
|
||||
AR PL Mingti2L Big5:style=Reguler</screen>
|
||||
<para>但是在使用 fontconfig 時,中文方面還有些比較特殊的需求。
|
||||
例如字型破碎的問題,必須修改 freetype2 將 BYTECODE INTERPRETER 給啟用。
|
||||
本身沒有粗體、粗斜體的設計。字距過大是因為某些字型是固定字距,
|
||||
但是因為含有 CJK 字型,系統以 CJK 字型的寬度作為英數字型的寬度。
|
||||
字型名稱(family)不支援中文的使用。</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="setlocale">
|
||||
<title>中文 locale 的設定</title>
|
||||
<para>
|
||||
當一個程式啟動時,系統會預設給它一個初始 locale,稱為 POSIX 或
|
||||
C locale。在此 locale 下,程式的表現會與傳統的 C 語言中一樣,
|
||||
使用英文做訊息輸出,只能處理英文等 ASCII 碼等等。
|
||||
如果該程式有支援 I18N,也就是說它有按照 I18N 的標準來寫,
|
||||
則它在啟動後就會馬上呼叫系統函式來改變它的 locale,
|
||||
如此它就搖身一變,變成可以處理該 locale 所代表的地區語文了。</para>
|
||||
<para>zh_TW.Big5 是目前台灣內廣泛使用的 locale,
|
||||
zh 是華語(Chinese),1998 年 ISO639 裡面以兩個英文字母來代表語言編碼,
|
||||
這個縮寫據我所知沒有任何含義,而 TW 代表的就是台灣(Taiwan)
|
||||
地區的縮寫,最後的 Big5 則是編碼方式。</para>
|
||||
<para>zh_TW.Big5 的 locale 設定檔在
|
||||
<filename>/usr/src/share/mklocale/zh_TW.Big5.src</filename>,
|
||||
而實作中,則是儲存在 <filename>/usr/share/locale/</filename> 目錄下,
|
||||
以我們的 zh_TW.Big5 locale 為例,該目錄中就包含了
|
||||
<filename>LC_COLLATE</filename>、<filename>LC_CTYPE</filename>、
|
||||
<filename>LC_TIME</filename>。</para>
|
||||
<para>
|
||||
而 LC_MESSAGES 則是儲存在 <filename>/usr/local/share/locale/zh_TW/LC_MESSAGES/
|
||||
</filename> 或是 <filename>/usr/X11R6/share/locale/zh_TW.Big5/
|
||||
</filename> 底下。由於 LC_MESSAGES 類別掌管的是程式訊息輸出所用的語言,
|
||||
而且不同程式間的訊息都不會一樣,因此它不能像其他類別一樣,
|
||||
只提供單一一個資料檔即可。相反的,
|
||||
在這裏所採取的方式是由各應用程式自行提供它們的訊息資料檔,
|
||||
並統一放在各 locale 的 LC_MESSAGES 的目錄下。例如 mutt 程式,
|
||||
其訊息的部分除了英文以外,可能還同時提供了繁體中文、簡體中文、
|
||||
日文、法文 等翻譯,因此,在以上這些語文所代表的 locale 中,
|
||||
其底下的 LC_MESSAGES 目錄中都會有一份屬於 mutt 程式的訊息資料檔。
|
||||
換句話說,在 I18N 架構下,程式訊息部分是與程式分離的,
|
||||
如此才能分別對各 locale 做 ``區域化'' (即翻譯成各地區的語言)。
|
||||
如此,當 mutt 在執行時,系統會根據目前它的 LC_MESSAGES locale
|
||||
設定去找找看有沒有它的訊息資料檔存在,有的話就以該語言做訊息輸出,
|
||||
否則的話則以 C locale 的方式 (即英文) 來輸出訊息。 </para>
|
||||
<para>
|
||||
以上所有的 locale 類別中,除了 LC_MESSAGES 之外,最重要的就是
|
||||
LC_CTYPE 了。此類別掌管的是該 locale 中所有字元的處理方式。
|
||||
一個應用程式若要能被 ``區域化'' 成某地區的語文,
|
||||
首要工作就是要能處理該地區的文字。例如每個字的內碼如何編碼?
|
||||
是單一 byte 還是由多個 bytes 組成的?怎樣的編碼才是合法可用的?
|
||||
這個字是不是可以印?是不是數字?若給定任意的文字字串,
|
||||
要如何能區分出一個個字 等等。因此,此類別牽涉的層面相當廣,
|
||||
除了程式本身的文字處理能力以外,甚至到 X Window 中的文字顯示
|
||||
(即 XOM: X Output Method)、文字輸入 (即 XIM: X Input Method) 等等,
|
||||
都與它有關。因此,當我們要開始使用一個支援 I18N 的程式之前,
|
||||
一定要先設好 LC_CTYPE 這個 locale 類別。 </para>
|
||||
<sect2>
|
||||
<title>設定 Shell locale 環境變數</title>
|
||||
<para>
|
||||
我們必須指定 zh_TW.Big5 這個 locale 環境變數給 Shell,Shell
|
||||
才能正確的處理中文訊息,一般而言我們只要指定 locale 的字元定義
|
||||
LC_CTYPE 為 zh_TW.Big5 即可讓 Shell 正確的處理中文,若要讓
|
||||
Shell 的輸出訊息也顯示中文,則可將 locale 訊息顯示 LC_MESSAGES
|
||||
也設定為中文的 locale data。</para>
|
||||
<para>
|
||||
至於要設定 stty pass8 的原因是,台灣地區所通行的 Big5 編碼,
|
||||
及大陸地區所使用的 GB 編碼,其開頭的位元幾乎都是大於 128 的數值,
|
||||
也就是所謂 non-ASCII 碼的範圍(ASCII 是指小於 128 的編碼)。
|
||||
中文問題就在這裡,許多程式由於各式各樣的原因,
|
||||
並未考慮到輸入的資料可能是 non-ASCII 碼的問題,
|
||||
程式往往假設了她所要處理的資料都是 ASCII 碼
|
||||
(因為大部分軟體為外國人發展的),更糟糕的是,
|
||||
當程式遇到 non-ASCII 碼時,常常假設她不存在,
|
||||
而將它的第八個位元截去,這是所謂的 8-bit 輸入中文時,
|
||||
每每將第八位元砍掉,所以中文都變成亂碼。因此必須指定 stty pass8,
|
||||
警告 Shell 不要將輸入的第八個位元截掉,這樣才能正確顯示中文。</para>
|
||||
<para>
|
||||
ENABLE_STARTUP_LOCALE 則是 a.out 遺物,他會強制 ld.so 載入程式前,
|
||||
先呼叫 setlocale(),在 3.x 前就把這個 ugly hack 拿掉了。</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<title>字元的分類與編碼</title>
|
||||
<para>一個 locale 所包含的合法字元與其編碼方式,我們稱之為
|
||||
character set (字集)。以我們的 zh_TW.Big5 locale 為例,
|
||||
其實它內部包含了兩個 sub-character set,一個是 ASCII
|
||||
用來表示一編的英文、數字、電腦慣用符號 等等,另一個就是以
|
||||
Big5 編碼方式的,我們俗稱的 ``全形'' 字,包括了中文字、
|
||||
全形英文、數字、以及符號 等。前者每個字元的長度是一個
|
||||
byte,而後者每個字元的長度則是兩個 byte。</para>
|
||||
<para>在 locale 的設定中,以 LC_CTYPE 最為重要,
|
||||
LC_CTYPE 包含了字元內碼資訊,
|
||||
直接影響部份 C 函式隊字元的處理結果,包括:</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
ctype.h:
|
||||
isalnum(), isalpha(), iscntrl(), isdigit(), isgraph(), islower(),
|
||||
isprint(), ispunct(), isspace(), isupper(), isxdigit(), tolower(),
|
||||
toupper().
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
wctype.h:
|
||||
iswalnum(), iswalpha(), iswcntrl(), iswdigit(), iswgraph(), iswlower(),
|
||||
iswprint(), iswpunct(), iswspace(), iswupper(), iswxdigit(),
|
||||
towlower(), towupper().
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
stdlib.h:
|
||||
mblen(), mbtowc(), mbstowcs(), wctomb(), wcstombs().
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>zh_TW.Big5 locale 的設定檔在
|
||||
<filename>/usr/src/share/mklocale/zh_TW.Big5.src</filename>,
|
||||
在 LC_CTYPE 的設定檔中,它將所有的字元分類成以下幾種:</para>
|
||||
<programlisting>
|
||||
UPPER: 拼音字的大寫字。
|
||||
LOWER: 拼音字的小寫字。
|
||||
ALPHA: 所有的拼音字母。
|
||||
DIGIT: 阿拉伯數字。
|
||||
SPACE: 空隔字元,如空白 (space)、換行、tab ...字元等。
|
||||
XDIGIT: 代表十六進位數字的字元。
|
||||
BLANK: 空白字元,通常只包括空白 (space) 與 tab 兩個。
|
||||
CNTRL: 電腦的控制字元。
|
||||
PUNCT: 標點符號。
|
||||
GRAPH: 所有有筆畫的字元,不包括空白與空格。
|
||||
PRINT: 所有可以印出的字元,包括空白 (blank) 字元。
|
||||
TOUPPER: 小寫拼音字母轉大寫拼音字母的對應表。
|
||||
TOLOWER: 大寫拼音字母轉小寫拼音字母的對應表。</programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tzsetup">
|
||||
<title>時區的設定</title>
|
||||
<para>Last Update: 2002年12月30日 周一 00時13分37秒 CST</para>
|
||||
<para>
|
||||
我們的時區是 CST,如果設定錯的話 <command>date</command>
|
||||
跟檔案建立的時間看起來就會很怪。
|
||||
</para>
|
||||
<para>使用 <command>tzsetup</command> 來修改:</para>
|
||||
<para>
|
||||
首先安裝程式會問,您的 CMOS 時間是否是格林威治時間(UTC),
|
||||
我們的 CMOS 通常都是設為當地的時間,所以請選 『NO』。
|
||||
接下來要選時區,我們選『5 Asia』、『43 Taiwan』。
|
||||
或是直接使用以下的指令。
|
||||
</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>tzsetup /usr/share/zoneinfo/Asia/Taipei</userinput>
|
||||
</screen>
|
||||
<para>另外也可以利用 <application>ntpdate</application> 來與網路時間協定
|
||||
(NTP) 伺服器對時。
|
||||
</para>
|
||||
<screen>
|
||||
&prompt.root; <userinput>ntpdate time.stdtime.gov.tw</userinput></screen>
|
||||
<para>比較常用的對時伺服器有:</para>
|
||||
<programlisting>
|
||||
time.stdtime.gov.tw
|
||||
clock.stdtime.gov.tw
|
||||
time.chttl.com.tw</programlisting>
|
||||
<note><para>如果想要漸漸調到正確,而不是馬上調準,可以用 ntpd,
|
||||
將 <option>server time.stdtime.gov.tw</option> 寫到
|
||||
<filename>/etc/ntp.conf</filename>。</para></note>
|
||||
<para>然後用 <command>date</command> 確認一下時間是不是正確。</para>
|
||||
<screen>
|
||||
&prompt.user; <userinput>date</userinput>
|
||||
2002年12月30日 周一 00時13分37秒 CST</screen>
|
||||
</sect1>
|
||||
|
||||
|
||||
</chapter>
|
||||
|
||||
<!--
|
||||
Local Variables:
|
||||
mode: sgml
|
||||
sgml-declaration: "../chapter.decl"
|
||||
sgml-indent-data: t
|
||||
sgml-omittag: nil
|
||||
sgml-always-quote-attributes: t
|
||||
sgml-parent-document: ("../zh-tut.sgml" "part" "chapter")
|
||||
End:
|
||||
-->
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<!--
|
||||
The Chinese FreeBSD Documentation Project
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY freebsd.dsl SYSTEM "../../share/sgml/freebsd.dsl" CDATA DSSSL>
|
||||
<!ENTITY % lang.zh.dsssl "IGNORE">
|
||||
]>
|
||||
|
||||
<style-sheet>
|
||||
<style-specification use="docbook">
|
||||
<style-specification-body>
|
||||
<![ %lang.zh.dsssl; [
|
||||
(define %gentext-language% "zh")
|
||||
]]>
|
||||
|
||||
(define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=Big5"))))
|
||||
|
||||
</style-specification-body>
|
||||
</style-specification>
|
||||
|
||||
<external-specification id="docbook" document="freebsd.dsl">
|
||||
</style-sheet>
|
||||
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
|
@ -1,9 +0,0 @@
|
|||
<!-- $FreeBSD$ -->
|
||||
<figure>
|
||||
<title> snapshot</title>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/" format="PNG">
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
</figure>
|
||||
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 212 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 312 KiB |
|
Before Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 204 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |