The following documentation is written in EUC-CN encoding.
-Èç¹ûÄãÓÃÒ»°ãµÄÎÄ×Ö±à¼Æ÷ÔÄÀÀÕâ·ÝÎļþ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û.
-Õâ·ÝÎļþÊÇÒÔ POD (¼òÃ÷Îļþ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜÈÃÈËÖ±½Ó¶ÁÈ¡,
+?ç¹?ÄãÓÃÒ»°ãµÄÎÄ×Ö±à¼Æ÷ÔÄÀÀÕâ·ÝÎļþ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û.
+Õâ·ÝÎļþÊÇÒÔ POD (¼òÃ÷Îļþ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜ?ÃÈËÖ±½Ó¶ÁÈ?,
¶øÌرðÉè¼ÆµÄ. ¹ØÓڴ˸ñʽµÄ½øÒ»²½ÐÅÏ¢, Çë²Î¿¼ perlpod ÏßÉÏÎļþ.
=head1 NAME
»¶ÓÀ´µ½ Perl µÄÌìµØ!
´Ó 5.8.0 °æ¿ªÊ¼, Perl ¾ß±¸ÁËÍêÉÆµÄ Unicode (ͳһÂë) Ö§Ô®,
-Ò²Á¬´øÖ§Ô®ÁËÐí¶àÀ¶¡ÓïϵÒÔÍâµÄ±àÂ뷽ʽ; CJK (ÖÐÈÕº«) ±ãÊÇÆäÖеÄÒ»²¿·Ý.
+Ò²Á¬´øÖ§Ô®ÁËÐí¶àÀ¶¡ÓïϵÒÔÍâµÄ±àÂ뷽ʽ; CJK (ÖÐ?Õº?) ±ãÊÇÆäÖеÄÒ»²¿·Ý.
Unicode Êǹú¼ÊÐԵıê×¼, ÊÔͼº¸ÇÊÀ½çÉÏËùÓеÄ×Ö·û: Î÷·½ÊÀ½ç, ¶«·½ÊÀ½ç,
ÒÔ¼°Á½Õß¼äµÄÒ»ÇÐ (Ï£À°ÎÄ, ÐðÀûÑÇÎÄ, ÑÇÀ²®ÎÄ, Ï£²®À´ÎÄ, Ó¡¶ÈÎÄ,
-Ó¡µØ°²ÎÄ, µÈµÈ). ËüÒ²ÈÝÄÉÁ˶àÖÖ×÷ҵϵͳÓëƽ̨ (Èç PC ¼°Âó½ðËþ).
+Ó¡µØ°²ÎÄ, µÈµÈ). ËüÒ²?ÝÄÉÁ˶àÖÖ×÷ҵϵͳÓëƽÌ? (?? PC ¼°Âó½ðËþ).
Perl ±¾ÉíÒÔ Unicode ½øÐвÙ×÷. Õâ±íʾ Perl ÄÚ²¿µÄ×Ö·û´®Êý¾Ý¿ÉÓà Unicode
-±íʾ; Perl µÄº¯Ê½ÓëËã·û (ÀýÈçÕý¹æ±íʾʽ±È¶Ô) Ò²ÄÜ¶Ô Unicode ½øÐвÙ×÷.
-ÔÚÊäÈë¼°Êä³öʱ, ΪÁË´¦ÀíÒÔ Unicode ֮ǰµÄ±àÂ뷽ʽ´¢´æµÄÊý¾Ý, Perl
-ÌṩÁË Encode Õâ¸öÄ£¿é, ¿ÉÒÔÈÃÄãÇáÒ׵ضÁÈ¡¼°Ð´Èë¾ÉÓеıàÂëÊý¾Ý.
+±íʾ; Perl µÄº¯Ê½ÓëËã·û (Àý?çÕ?¹æ±íʾʽ±È¶Ô) Ò²ÄÜ¶Ô Unicode ½øÐвÙ×÷.
+ÔÚÊä?ë¼°Êä³öÊ?, ΪÁË´¦ÀíÒÔ Unicode ֮ǰµÄ±àÂ뷽ʽ´æ·ÅµÄÊý¾Ý, Perl
+ÌṩÁË Encode Õâ¸öÄ£¿é, ¿ÉÒÔ?ÃÄãÇáÒ׵ضÁÈ¡¼°Ð´Èë¾ÉÓеıàÂëÊ?¾Ý.
-Encode ÑÓÉìÄ£¿éÖ§Ô®ÏÂÁмòÌåÖÐÎĵıàÂ뷽ʽ:
+Encode ÑÓÉìÄ£¿éÖ§Ô®ÏÂÁмòÌåÖÐÎĵıàÂ뷽ʽ ('gb2312' ±íʾ 'euc-cn'):
euc-cn Unix ÑÓÉì×Ö·û¼¯, Ò²¾ÍÊÇË׳ƵĹú±êÂë
- gb2312 δ¾´¦ÀíµÄ (µÍ±ÈÌØ) GB2312 ×Ö·û±í
+ gb2312-raw δ¾´¦ÀíµÄ (µÍ±ÈÌØ) GB2312 ×Ö·û±í
gb12345 δ¾´¦ÀíµÄÖйúÓ÷±ÌåÖÐÎıàÂë
iso-ir-165 GB2312 + GB6345 + GB8565 + ÐÂÔö×Ö·û
- cp936 ×ÖÂëÒ³ 936, Ò²³ÆΪ GBK (À©³ä¹ú±êÂë)
+ cp936 ×ÖÂëÒ³ 936, Ò²¿ÉÒÔÓà 'GBK' (À©³ä¹ú±êÂë) Ö¸Ã÷
hz 7 ±ÈÌØÒݳöʽ GB2312 ±àÂë
-¾ÙÀýÀ´Ëµ, ½« EUC-CN ±àÂëµÄµµ°¸×ª³É Unicode, ìóÐè¼üÈëÏÂÁÐÖ¸Áî:
+¾ÙÀýÀ´Ëµ, ½« EUC-CN ±àÂëµÄÎĵµ×ª³É Unicode, ìóÐè¼ü?ëÏÂÁÐÖ¸Á?:
perl -Mencoding=euc-cn,STDOUT,utf8 -pe1 < file.euc-cn > file.utf8
-Perl Ò²ÄÚ¸½ÁË "piconv", Ò»Ö§ÍêÈ«ÒÔ Perl д³ÉµÄ×Ö·ûת»»¹¤¾ß³ÌÐò, Ó÷¨ÈçÏÂ:
+Perl Ò²ÄÚ¸½ÁË "piconv", Ò»Ö§Íê?«Ò? Perl д³ÉµÄ×Ö·ûת»»¹¤¾ß³ÌÐò, Ó÷¨?çÏ?:
piconv -f euc-cn -t utf8 < file.euc-cn > file.utf8
piconv -f utf8 -t euc-cn < file.utf8 > file.euc-cn
-ÁíÍâ, ÀûÓà encoding Ä£¿é, Äã¿ÉÒÔÇáÒ×д³öÒÔ×Ö·ûΪµ¥Î»µÄ³ÌÐòÂë, ÈçÏÂËùʾ:
+ÁíÍâ, ÀûÓà encoding Ä£¿é, Äã¿ÉÒÔÇáÒ×д³öÒÔ×Ö·ûΪµ¥Î»µÄ³ÌÐòÂë, ?çÏÂËùÊ?:
#!/usr/bin/env perl
- # Æô¶¯ euc-cn ×Ö´®½âÎö; ±ê×¼Êä³öÈë¼°±ê×¼´íÎó¶¼ÉèΪ euc-cn ±àÂë
+ # Æô¶¯ euc-cn ×Ö´®½âÎö; ±ê×¼Êä³ö?ë¼°±ê×¼´íÎó¶¼ÉèÎ? euc-cn ±àÂë
use encoding 'euc-cn', STDIN => 'euc-cn', STDOUT => 'euc-cn';
print length("ÂæÍÕ"); # 2 (Ë«ÒýºÅ±íʾ×Ö·û)
- print length('ÂæÍÕ'); # 4 (µ¥ÒýºÅ±íʾλԪ×é)
+ print length('ÂæÍÕ'); # 4 (µ¥ÒýºÅ±íʾ×Ö½Ú)
print index("×»×»½Ì»å", "»×»½"); # -1 (²»°üº¬´Ë×Ó×Ö·û´®)
print index('×»×»½Ì»å', '»×»½'); # 1 (´ÓµÚ¶þ¸ö×Ö½Ú¿ªÊ¼)
-ÔÚ×îºóÒ»ÁÐÀý×ÓÀï, "×»" µÄµÚ¶þ¸öλԪ×éÓë "×»" µÄµÚÒ»¸öλԪ×é½áºÏ³É EUC-CN
-ÂëµÄ "»×"; "×»" µÄµÚ¶þ¸öλԪ×éÔòÓë "½Ì" µÄµÚÒ»¸öλԪ×é½áºÏ³É "»½".
+ÔÚ×îºóÒ»ÁÐÀý×ÓÀï, "×»" µÄµÚ¶þ¸ö×Ö½ÚÓë "×»" µÄµÚÒ»¸ö×Ö½Ú½áºÏ³É EUC-CN
+ÂëµÄ "»×"; "×»" µÄµÚ¶þ¸ö×Ö½ÚÔòÓë "½Ì" µÄµÚÒ»¸ö×Ö½Ú½áºÏ³É "»½".
Õâ½â¾öÁËÒÔÇ° EUC-CN Âë±È¶Ô´¦ÀíÉϳ£¼ûµÄÎÊÌâ.
=head2 ¶îÍâµÄÖÐÎıàÂë
-Èç¹ûÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L<http://www.cpan.org/>) ÏÂÔØ
+?ç¹?ÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L<http://www.cpan.org/>) ÏÂÔØ
Encode::HanExtra Ä£¿é. ËüÄ¿Ç°ÌṩÏÂÁбàÂ뷽ʽ:
gb18030 À©³ä¹ýµÄ¹ú±êÂë, °üº¬·±ÌåÖÐÎÄ
big5-simp Big5 ·±ÌåÖÐÎÄÓë Unicode ¼òÌåÖÐÎÄ»¥×ª
gbk-trad GBK ¼òÌåÖÐÎÄÓë Unicode ·±ÌåÖÐÎÄ»¥×ª
-ÈôÏëÔÚ GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½Ö§³ÌÐò,
+?ôÏëÔ? GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½Ö§³ÌÐò,
»òÔÚ³ÌÐòÄÚʹÓÃÏÂÁÐд·¨:
use Encode::HanConvert;
=head2 ½øÒ»²½µÄÐÅÏ¢
-Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îļþ (²»ÐÒÈ«ÊÇÓÃÓ¢ÎÄдµÄ), À´Ñ§Ï°¸ü¶à¹ØÓÚ
+Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îļþ (²»ÐÒ?«ÊÇÓÃÓ?ÎÄдµÄ), À´Ñ§Ï°¸ü¶à¹ØÓÚ
Perl µÄ֪ʶ, ÒÔ¼° Unicode µÄʹÓ÷½Ê½. ²»¹ý, ÍⲿµÄ×ÊÔ´Ï൱·á¸»:
=head2 Ìṩ Perl ×ÊÔ´µÄÍøÖ·
Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
-ÌÆ×Úºº E<lt>autrijus@autrijus.orgE<gt>
+Autrijus Tang (ÌÆ×Úºº) E<lt>autrijus@autrijus.orgE<gt>
=cut
¦b¿é¤J¤Î¿é¥X®É, ¬°¤F³B²z¥H Unicode ¤§«eªº½s½X¤è¦¡Àx¦sªº¸ê®Æ, Perl
´£¨Ñ¤F Encode ³oÓ¼Ò²Õ, ¥i¥HÅý§A»´©ö¦aŪ¨ú¤Î¼g¤J¦³ªº½s½X¸ê®Æ.
-Encode ©µ¦ù¼Ò²Õ¤ä´©¤U¦C¥¿Å餤¤åªº½s½X¤è¦¡:
+Encode ©µ¦ù¼Ò²Õ¤ä´©¤U¦C¥¿Å餤¤åªº½s½X¤è¦¡ ('big5' ªí¥Ü 'big5-eten'):
- big5 ì©lªº Big5 ½s½X (§tʤѤé¤å¦r§Î)
- big5-hkscs Big5 + »´ä¥~¦r¶°
+ big5-eten Big5 ½s½X (§tʤѩµ¦ù¦r§Î)
+ big5-hkscs Big5 + »´ä¥~¦r¶°, 2001 ¦~ª©
cp950 ¦r½X¶ 950 (Big5 + ·L³n²K¥[ªº¦r²Å)
Á|¨Ò¨Ó»¡, ±N Big5 ½s½XªºÀÉ®×Âন Unicode, ¯»ÝÁä¤J¤U¦C«ü¥O:
¦pªG»Ýn§ó¦hªº¤¤¤å½s½X, ¥i¥H±q CPAN (L<http://www.cpan.org/>) ¤U¸ü
Encode::HanExtra ¼Ò²Õ. ¥¦¥Ø«e´£¨Ñ¤U¦C½s½X¤è¦¡:
+ cccii 1980 ¦~¤å«Ø·|ªº¤¤¤å¸ê°T¥æ´«½X
euc-tw Unix ©µ¦ù¦r²Å¶°, ¥]§t CNS11643 ¥± 1-7
big5plus ¤¤¤å¼Æ¦ì¤Æ§Þ³N±À¼s°òª÷·|ªº Big5+
+ big5ext ¤¤¤å¼Æ¦ì¤Æ§Þ³N±À¼s°òª÷·|ªº Big5e
¥t¥~, Encode::HanConvert ¼Ò²Õ«h´£¨Ñ¤F²ÁcÂà´«¥Îªº¨âºØ½s½X:
Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
-ð©vº~ E<lt>autrijus@autrijus.orgE<gt>
+Autrijus Tang (ð©vº~) E<lt>autrijus@autrijus.orgE<gt>
=cut