1 | If you read this file _as_is_, just ignore the funny characters you
|
---|
2 | see. It is written in the POD format (see perlpod manpage) which is
|
---|
3 | specially designed to be readable as is.
|
---|
4 |
|
---|
5 | The following documentation is written in Big5 encoding.
|
---|
6 |
|
---|
7 | ŠpªG§A¥Î€@¯ëªº€åŠrœs¿èŸ¹Ÿ\Äý³o¥÷€å¥ó, œÐ©¿²€€å€€©_¯Sªºµù°OŠr²Å.
|
---|
8 | ³o¥÷€å¥ó¬O¥H POD (²©ú€å¥ó®æŠ¡) ŒgŠš; ³oºØ®æŠ¡¬O¬°€F¯àÅý€Hªœ±µÅªšú,
|
---|
9 | ŠÓ¯S§O³]pªº. Ãö©óŠ¹®æŠ¡ªº¶i€@šBžê°T, œÐ°ÑŠÒ perlpod œu€W€å¥ó.
|
---|
10 |
|
---|
11 | =head1 NAME
|
---|
12 |
|
---|
13 | perltw - ¥¿Å退€å Perl «ü«n
|
---|
14 |
|
---|
15 | =head1 DESCRIPTION
|
---|
16 |
|
---|
17 | ÅwªïšÓšì Perl ªº€ÑŠa!
|
---|
18 |
|
---|
19 | ±q 5.8.0 ª©¶}©l, Perl šã³Æ€F§¹µœªº Unicode (žU°êœX) €äŽ©,
|
---|
20 | €]³s±a€äŽ©€F³\Šh©Ô€B»yšt¥H¥~ªºœsœX€èŠ¡; CJK (€€€éÁú) «K¬Ošä€€ªº€@³¡¥÷.
|
---|
21 | Unicode ¬O°ê»Ú©ÊªºŒÐ·Ç, žÕ¹Ï²[»\¥@¬É€W©ÒŠ³ªºŠr²Å: Šè€è¥@¬É, ªF€è¥@¬É,
|
---|
22 | ¥H€ÎšâªÌ¶¡ªº€@€Á (§Æ߀å, ±Ô§QšÈ€å, ªü©Ô§B€å, §Æ§BšÓ€å, ŠL«×€å,
|
---|
23 | ŠLŠaŠw€å, µ¥µ¥). ¥Š€]®e¯Ç€FŠhºØ§@·~št²Î»P¥»O (Šp PC €Î³Áª÷¶ð).
|
---|
24 |
|
---|
25 | Perl ¥»š¥H Unicode ¶iŠæŸÞ§@. ³oªí¥Ü Perl €º³¡ªºŠrŠêžê®Æ¥i¥Î Unicode
|
---|
26 | ªí¥Ü; Perl ªºšçŠ¡»Pºâ²Å (šÒŠp¥¿³Wªí¥ÜŠ¡€ñ¹ï) €]¯à¹ï Unicode ¶iŠæŸÞ§@.
|
---|
27 | Šb¿é€J€Î¿é¥X®É, ¬°€F³B²z¥H Unicode €§«eªºœsœX€èŠ¡ÀxŠsªºžê®Æ, Perl
|
---|
28 | Ž£šÑ€F Encode ³oӌҲÕ, ¥i¥HÅý§A»Ž©öŠaŪšú€ÎŒg€JŠ³ªºœsœXžê®Æ.
|
---|
29 |
|
---|
30 | Encode ©µŠùŒÒ²Õ€äŽ©€UŠC¥¿Å退€åªºœsœX€èŠ¡ ('big5' ªí¥Ü 'big5-eten'):
|
---|
31 |
|
---|
32 | big5-eten Big5 œsœX (§tʀѩµŠùŠr§Î)
|
---|
33 | big5-hkscs Big5 + »Žä¥~Šr¶°, 2001 Š~ª©
|
---|
34 | cp950 ŠrœX¶ 950 (Big5 + ·L³n²K¥[ªºŠr²Å)
|
---|
35 |
|
---|
36 | Á|šÒšÓ»¡, ±N Big5 œsœXªºÀÉ®×ÂàŠš Unicode, ¯»ÝÁä€J€UŠC«ü¥O:
|
---|
37 |
|
---|
38 | perl -Mencoding=big5,STDOUT,utf8 -pe1 < file.big5 > file.utf8
|
---|
39 |
|
---|
40 | Perl €]€ºªþ€F "piconv", €@€ä§¹¥þ¥H Perl ŒgŠšªºŠr²ÅÂàŽ«€ušãµ{Š¡, ¥ÎªkŠp€U:
|
---|
41 |
|
---|
42 | piconv -f big5 -t utf8 < file.big5 > file.utf8
|
---|
43 | piconv -f utf8 -t big5 < file.utf8 > file.big5
|
---|
44 |
|
---|
45 | ¥t¥~, §Q¥Î encoding ŒÒ²Õ, §A¥i¥H»Ž©öŒg¥X¥HŠr²Å¬°³æŠìªºµ{Š¡œX, Šp€U©Ò¥Ü:
|
---|
46 |
|
---|
47 | #!/usr/bin/env perl
|
---|
48 | # ±Ò°Ê big5 ŠrŠêžÑªR; ŒÐ·Ç¿é¥X€J€ÎŒÐ·Ç¿ù»~³£³]¬° big5 œsœX
|
---|
49 | use encoding 'big5', STDIN => 'big5', STDOUT => 'big5';
|
---|
50 | print length("ÀdŸm"); # 2 (Âù€Þž¹ªí¥ÜŠr²Å)
|
---|
51 | print length('ÀdŸm'); # 4 (³æ€Þž¹ªí¥ÜŠì€ž²Õ)
|
---|
52 | print index("œÎœÎ±Ð»£", "Μα"); # -1 (€£¥]§tŠ¹€lŠrŠê)
|
---|
53 | print index('œÎœÎ±Ð»£', 'Μα'); # 1 (±q²Ä€Gӊ쀞²Õ¶}©l)
|
---|
54 |
|
---|
55 | Šb³Ì«á€@ŠCšÒ€lžÌ, "œÎ" ªº²Ä€Gӊ쀞²Õ»P "œÎ" ªº²Ä€@ӊ쀞²Õµ²ŠXŠš Big5
|
---|
56 | œXªº "Îœ"; "œÎ" ªº²Ä€Gӊ쀞²Õ«h»P "±Ð" ªº²Ä€@ӊ쀞²Õµ²ŠXŠš "α".
|
---|
57 | ³ožÑšM€F¥H«e Big5 œX€ñ¹ï³B²z€W±`š£ªº°ÝÃD.
|
---|
58 |
|
---|
59 | =head2 ÃB¥~ªº€€€åœsœX
|
---|
60 |
|
---|
61 | ŠpªG»Ýn§óŠhªº€€€åœsœX, ¥i¥H±q CPAN (L<http://www.cpan.org/>) €Užü
|
---|
62 | Encode::HanExtra ŒÒ²Õ. ¥Š¥Ø«eŽ£šÑ€UŠCœsœX€èŠ¡:
|
---|
63 |
|
---|
64 | cccii 1980 Š~€å«Ø·|ªº€€€åžê°T¥æŽ«œX
|
---|
65 | euc-tw Unix ©µŠùŠr²Å¶°, ¥]§t CNS11643 ¥± 1-7
|
---|
66 | big5plus €€€åŒÆŠì€Æ§Þ³N±ÀŒs°òª÷·|ªº Big5+
|
---|
67 | big5ext €€€åŒÆŠì€Æ§Þ³N±ÀŒs°òª÷·|ªº Big5e
|
---|
68 |
|
---|
69 | ¥t¥~, Encode::HanConvert ŒÒ²Õ«hŽ£šÑ€F²ÁcÂàŽ«¥ÎªºšâºØœsœX:
|
---|
70 |
|
---|
71 | big5-simp Big5 ¥¿Å退€å»P Unicode ²Å退€å€¬Âà
|
---|
72 | gbk-trad GBK ²Å退€å»P Unicode ¥¿Å退€å€¬Âà
|
---|
73 |
|
---|
74 | Y·QŠb GBK »P Big5 €§¶¡€¬Âà, œÐ°ÑŠÒžÓŒÒ²Õ€ºªþªº b2g.pl »P g2b.pl šâ€äµ{Š¡,
|
---|
75 | ©ÎŠbµ{Š¡€ºšÏ¥Î€UŠCŒgªk:
|
---|
76 |
|
---|
77 | use Encode::HanConvert;
|
---|
78 | $euc_cn = big5_to_gb($big5); # ±q Big5 Âର GBK
|
---|
79 | $big5 = gb_to_big5($euc_cn); # ±q GBK Âର Big5
|
---|
80 |
|
---|
81 | =head2 ¶i€@šBªºžê°T
|
---|
82 |
|
---|
83 | œÐ°ÑŠÒ Perl €ºªþªº€j¶q»¡©ú€å¥ó (€£©¯¥þ¬O¥Î^€åŒgªº), šÓŸÇ²ß§óŠhÃö©ó
|
---|
84 | Perl ªºªŸÃÑ, ¥H€Î Unicode ªºšÏ¥Î€èŠ¡. €£¹L, ¥~³¡ªºžê·œ¬Û·íÂ׎I:
|
---|
85 |
|
---|
86 | =head2 Ž£šÑ Perl žê·œªººô§}
|
---|
87 |
|
---|
88 | =over 4
|
---|
89 |
|
---|
90 | =item L<http://www.perl.com/>
|
---|
91 |
|
---|
92 | Perl ªºº¶ (¥ÑŒÚµÜ§€œ¥qºûÅ@)
|
---|
93 |
|
---|
94 | =item L<http://www.cpan.org/>
|
---|
95 |
|
---|
96 | Perl ºîŠXšåÂúô (Comprehensive Perl Archive Network)
|
---|
97 |
|
---|
98 | =item L<http://lists.perl.org/>
|
---|
99 |
|
---|
100 | Perl ¶l»Œœ×ŸÂ€@Äý
|
---|
101 |
|
---|
102 | =back
|
---|
103 |
|
---|
104 | =head2 ŸÇ²ß Perl ªººô§}
|
---|
105 |
|
---|
106 | =over 4
|
---|
107 |
|
---|
108 | =item L<http://www.oreilly.com.tw/chinese/perl/index.html>
|
---|
109 |
|
---|
110 | ¥¿Å退€åª©ªºŒÚµÜ§ Perl ®ÑÂÇ
|
---|
111 |
|
---|
112 | =item L<http://groups.google.com/groups?q=tw.bbs.comp.lang.perl>
|
---|
113 |
|
---|
114 | »OÆW Perl ³sœu°Qœ×°Ï (€]ŽN¬OŠU€j BBS ªº Perl ³sœuª©)
|
---|
115 |
|
---|
116 | =back
|
---|
117 |
|
---|
118 | =head2 Perl šÏ¥ÎªÌ¶°·|
|
---|
119 |
|
---|
120 | =over 4
|
---|
121 |
|
---|
122 | =item L<http://www.pm.org/groups/asia.shtml#Taiwan>
|
---|
123 |
|
---|
124 | »OÆW Perl ±ÀŒs²Õ€@Äý
|
---|
125 |
|
---|
126 | =item L<http://irc.elixus.org/>
|
---|
127 |
|
---|
128 | ÃÀ¥ßšóœu€W²á€Ñ«Ç
|
---|
129 |
|
---|
130 | =back
|
---|
131 |
|
---|
132 | =head2 Unicode ¬ÛÃöºô§}
|
---|
133 |
|
---|
134 | =over 4
|
---|
135 |
|
---|
136 | =item L<http://www.unicode.org/>
|
---|
137 |
|
---|
138 | Unicode ŸÇ³NŸÇ·| (Unicode ŒÐ·Çªºšî©wªÌ)
|
---|
139 |
|
---|
140 | =item L<http://www.cl.cam.ac.uk/%7Emgk25/unicode.html>
|
---|
141 |
|
---|
142 | Unix/Linux €Wªº UTF-8 €Î Unicode µª«È°Ý
|
---|
143 |
|
---|
144 | =back
|
---|
145 |
|
---|
146 | =head2 €€€å€Æžê°T
|
---|
147 |
|
---|
148 | =over 4
|
---|
149 |
|
---|
150 | =item ¬°€°»ò¥s "¥¿Å退€å" €£¥s "ÁcÅ退€å"?
|
---|
151 |
|
---|
152 | L<http://www.csie.ntu.edu.tw/~b7506051/mozilla/faq.html#faqglossary>
|
---|
153 |
|
---|
154 | =item €€€å€Æ³nÅéÁp·ù
|
---|
155 |
|
---|
156 | L<http://www.cpatch.org/>
|
---|
157 |
|
---|
158 | =item Linux ³nÅ退€å€Æp¹º
|
---|
159 |
|
---|
160 | L<http://www.linux.org.tw/CLDP/>
|
---|
161 |
|
---|
162 | =back
|
---|
163 |
|
---|
164 | =head1 SEE ALSO
|
---|
165 |
|
---|
166 | L<Encode>, L<Encode::TW>, L<encoding>, L<perluniintro>, L<perlunicode>
|
---|
167 |
|
---|
168 | =head1 AUTHORS
|
---|
169 |
|
---|
170 | Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
|
---|
171 |
|
---|
172 | Autrijus Tang (ð©vº~) E<lt>autrijus@autrijus.orgE<gt>
|
---|
173 |
|
---|
174 | =cut
|
---|