From: Audrey Tang Date: Thu, 25 Jul 2002 07:05:11 +0000 (+0800) Subject: README.jp and README.cn X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d587bbdc2f23329b3310bad2acc3bd3b8a99c29;p=p5sagit%2Fp5-mst-13.2.git README.jp and README.cn Message-id: <20020724230511.GA1327@not.autrijus.org> p4raw-id: //depot/perl@17692 --- diff --git a/README.cn b/README.cn index 8f03927..f223cdf 100644 --- a/README.cn +++ b/README.cn @@ -4,8 +4,8 @@ specially designed to be readable as is. The following documentation is written in EUC-CN encoding. -?ç¹?ÄãÓÃÒ»°ãµÄÎÄ×ֱ༭Æ÷ÔÄÀÀÕâ·ÝÎļþ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û. -Õâ·ÝÎļþÊÇÒÔ POD (¼òÃ÷Îļþ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜ?ÃÈËÖ±½Ó¶ÁÈ?, +Èç¹ûÄãÓÃÒ»°ãµÄÎÄ×ֱ༭Æ÷ÔÄÀÀÕâ·ÝÎļþ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û. +Õâ·ÝÎļþÊÇÒÔ POD (¼òÃ÷Îļþ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜÈÃÈËÖ±½ÓÔĶÁ, ¶øÌرðÉè¼ÆµÄ. ¹ØÓڴ˸ñʽµÄ½øÒ»²½ÐÅÏ¢, Çë²Î¿¼ perlpod ÏßÉÏÎļþ. =head1 NAME @@ -17,15 +17,15 @@ perlcn - »¶Ó­À´µ½ 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 ÑÓÉìÄ£¿éÖ§Ô®ÏÂÁмòÌåÖÐÎĵıàÂ뷽ʽ ('gb2312' ±íʾ 'euc-cn'): @@ -36,19 +36,19 @@ Encode 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 (µ¥ÒýºÅ±íʾ×Ö½Ú) @@ -61,7 +61,7 @@ Perl Ò² =head2 ¶îÍâµÄÖÐÎıàÂë -?ç¹?ÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L) ÏÂÔØ +Èç¹ûÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L) ÏÂÔØ Encode::HanExtra Ä£¿é. ËüÄ¿Ç°ÌṩÏÂÁбàÂ뷽ʽ: gb18030 À©³ä¹ýµÄ¹ú±êÂë, °üº¬·±ÌåÖÐÎÄ @@ -71,7 +71,7 @@ Encode::HanExtra Ä£ big5-simp Big5 ·±ÌåÖÐÎÄÓë Unicode ¼òÌåÖÐÎÄ»¥×ª gbk-trad GBK ¼òÌåÖÐÎÄÓë Unicode ·±ÌåÖÐÎÄ»¥×ª -?ôÏëÔ? GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½Ö§³ÌÐò, +ÈôÏëÔÚ GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½Ö§³ÌÐò, »òÔÚ³ÌÐòÄÚʹÓÃÏÂÁÐд·¨: use Encode::HanConvert; @@ -80,7 +80,7 @@ Encode::HanExtra Ä£ =head2 ½øÒ»²½µÄÐÅÏ¢ -Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îļþ (²»ÐÒ?«ÊÇÓÃÓ?ÎÄдµÄ), À´Ñ§Ï°¸ü¶à¹ØÓÚ +Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îļþ (²»ÐÒÈ«ÊÇÓÃÓ¢ÎÄдµÄ), À´Ñ§Ï°¸ü¶à¹ØÓÚ Perl µÄ֪ʶ, ÒÔ¼° Unicode µÄʹÓ÷½Ê½. ²»¹ý, ÍⲿµÄ×ÊÔ´Ï൱·á¸»: =head2 Ìṩ Perl ×ÊÔ´µÄÍøÖ· diff --git a/README.jp b/README.jp index 8fd4dcf..8f58535 100644 --- a/README.jp +++ b/README.jp @@ -78,7 +78,7 @@ Perl5.8 # jcode.pl require "jcode.pl"; while(<>){ - jcode::convert(*_, 'euc', 'sjis); + jcode::convert(*_, 'euc', 'sjis'); print; } # Jcode.pm @@ -93,7 +93,7 @@ Perl5.8 print; } # Perl 5.8 - encoding ¤òÍøÍѤ·¤Æ - use encoding 'euc-jp', STDIN=>'shiftjis' + use encoding 'euc-jp', STDIN => 'shiftjis'; while(<>){ print; }