The following documentation is written in EUC-CN encoding.
-?ç¹?ÄãÓÃÒ»°ãµÄÎÄ×Ö±à¼Æ÷ÔÄÀÀÕâ·ÝÎĵµ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û. Õâ·ÝÎÄ
-¼þÊÇÒÔ POD (¼òÃ÷Îĵµ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜ?ÃÈËÖ±½Ó¶ÁÈ¡¶øÌرðÉè¼?
-µÄ. ¹ØÓڴ˸ñʽµÄ½øÒ»²½×ÊѶ, Çë²Î¿¼ perlpod ÏßÉÏÎĵµ.
+Èç¹ûÄãÓÃÒ»°ãµÄÎÄ×Ö±à¼Æ÷ÔÄÀÀÕâ·ÝÎļþ, ÇëºöÂÔÎÄÖÐÆæÌصÄ×¢¼Ç×Ö·û.
+Õâ·ÝÎļþÊÇÒÔ POD (¼òÃ÷Îļþ¸ñʽ) д³É; ÕâÖÖ¸ñʽÊÇΪÁËÄÜÈÃÈËÖ±½Ó¶ÁÈ¡,
+¶øÌرðÉè¼ÆµÄ. ¹ØÓڴ˸ñʽµÄ½øÒ»²½ÐÅÏ¢, Çë²Î¿¼ perlpod ÏßÉÏÎļþ.
=head1 NAME
»¶ÓÀ´µ½ Perl µÄÌìµØ!
-´Ó 5.8.0 °æ¿ªÊ¼, Perl ¾ß±¸ÁËÏ꾡µÄ Unicode (ͳһÂë) Ö§Ô®, Ò²Á¬´øÖ§Ô®ÁË
-Ðí¶àÀ¶¡ÓïϵÒÔÍâµÄ±àÂ뷽ʽ; CJK (ÖÐ?Õº?) ±ãÊÇÆäÖеÄÒ»²¿·Ý. Unicode ÊÇ
-¹ú¼ÊÐԵıê×¼, ÊÔͼº¸ÇÊÀ½çÉÏËùÓеÄ×Ö·û: Î÷·½ÊÀ½ç, ¶«·½ÊÀ½ç, ÒÔ¼°Á½Õß¼ä
-µÄÒ»ÇÐ (Ï£À°ÎÄ, ÐðÀûÑÇÎÄ, °¢À²®ÎÄ, Ï£²®À´ÎÄ, Ó¡¶ÈÎÄ, Ó¡µØ°²ÎÄ, µÈµÈ).
-ËüÒ²?ÝÄÉÁ˶àÖÖ×÷ҵϵͳÓëƽÌ? (?? PC ¼°Âó½ðËþ).
+´Ó 5.8.0 °æ¿ªÊ¼, Perl ¾ß±¸ÁËÍêÉÆµÄ Unicode (ͳһÂë) Ö§Ô®,
+Ò²Á¬´øÖ§Ô®ÁËÐí¶àÀ¶¡ÓïϵÒÔÍâµÄ±àÂ뷽ʽ; CJK (ÖÐÈÕº«) ±ãÊÇÆäÖеÄÒ»²¿·Ý.
+Unicode Êǹú¼ÊÐԵıê×¼, ÊÔͼº¸ÇÊÀ½çÉÏËùÓеÄ×Ö·û: Î÷·½ÊÀ½ç, ¶«·½ÊÀ½ç,
+ÒÔ¼°Á½Õß¼äµÄÒ»ÇÐ (Ï£À°ÎÄ, ÐðÀûÑÇÎÄ, ÑÇÀ²®ÎÄ, Ï£²®À´ÎÄ, Ó¡¶ÈÎÄ,
+Ó¡µØ°²ÎÄ, µÈµÈ). ËüÒ²ÈÝÄÉÁ˶àÖÖ×÷ҵϵͳÓëƽ̨ (Èç PC ¼°Âó½ðËþ).
-Perl ±¾ÉíÒÔ Unicode ½øÐвÙ×÷. Õâ±íʾ Perl ÄÚ²¿µÄ×Ö´®×ÊÁÏ¿ÉÓà Unicode
-±íʾ, Perl µÄº¯Ê½ÓëËã·û (Àý?çÕ?¹æ±íʾʽ±È¶Ô) Ò²ÄÜ¶Ô Unicode ½øÐвÙ×÷.
-ÔÚÊä?ë¼°Êä³öÊ?, ΪÁË´¦ÀíÒÔ Unicode ֮ǰµÄ±àÂ뷽ʽ´¢´æµÄ×ÊÁÏ, Perl Ìṩ
-ÁË¡¸Encode¡¹Õâ¸öÄ£¿é, ¿ÉÒÔ?ÃÄãÇáÒ׵ضÁÈ¡¼°Ð´Èë¾ÉÓеıàÂë×ÊÁ?.
+Perl ±¾ÉíÒÔ Unicode ½øÐвÙ×÷. Õâ±íʾ Perl ÄÚ²¿µÄ×Ö·û´®Êý¾Ý¿ÉÓà Unicode
+±íʾ; Perl µÄº¯Ê½ÓëËã·û (ÀýÈçÕý¹æ±íʾʽ±È¶Ô) Ò²ÄÜ¶Ô Unicode ½øÐвÙ×÷.
+ÔÚÊäÈë¼°Êä³öʱ, ΪÁË´¦ÀíÒÔ Unicode ֮ǰµÄ±àÂ뷽ʽ´¢´æµÄÊý¾Ý, Perl
+ÌṩÁË Encode Õâ¸öÄ£¿é, ¿ÉÒÔÈÃÄãÇáÒ׵ضÁÈ¡¼°Ð´Èë¾ÉÓеıàÂëÊý¾Ý.
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 ±àÂë
- use encoding 'euc-cn', STDIN => 'euc-cn',
- STDOUT => 'euc-cn', STDERR => 'euc-cn';
-
+ # Æô¶¯ euc-cn ×Ö´®½âÎö; ±ê×¼Êä³öÈë¼°±ê×¼´íÎó¶¼ÉèΪ euc-cn ±àÂë
+ use encoding 'euc-cn', STDIN => 'euc-cn', STDOUT => 'euc-cn';
print length("ÂæÍÕ"); # 2 (Ë«ÒýºÅ±íʾ×Ö·û)
- print length('ÂæÍÕ'); # 4 (µ¥ÒýºÅ±íʾ×Ö½Ú)
- print index("×»×»½Ì»å", "»×»½"); # -1 (²»°üº¬´Ë×Ó×Ö´®)
+ print length('ÂæÍÕ'); # 4 (µ¥ÒýºÅ±íʾλԪ×é)
+ print index("×»×»½Ì»å", "»×»½"); # -1 (²»°üº¬´Ë×Ó×Ö·û´®)
print index('×»×»½Ì»å', '»×»½'); # 1 (´ÓµÚ¶þ¸ö×Ö½Ú¿ªÊ¼)
+ÔÚ×îºóÒ»ÁÐÀý×ÓÀï, "×»" µÄµÚ¶þ¸öλԪ×éÓë "×»" µÄµÚÒ»¸öλԪ×é½áºÏ³É EUC-CN
+ÂëµÄ "»×"; "×»" µÄµÚ¶þ¸öλԪ×éÔòÓë "½Ì" µÄµÚÒ»¸öλԪ×é½áºÏ³É "»½".
+Õâ½â¾öÁËÒÔÇ° EUC-CN Âë±È¶Ô´¦ÀíÉϳ£¼ûµÄÎÊÌâ.
+
=head2 ¶îÍâµÄÖÐÎıàÂë
-?ç¹?ÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L<http://www.cpan.org/>) ÏÂÔØ
+Èç¹ûÐèÒª¸ü¶àµÄÖÐÎıàÂë, ¿ÉÒÔ´Ó CPAN (L<http://www.cpan.org/>) ÏÂÔØ
Encode::HanExtra Ä£¿é. ËüÄ¿Ç°ÌṩÏÂÁбàÂ뷽ʽ:
gb18030 À©³ä¹ýµÄ¹ú±êÂë, °üº¬·±ÌåÖÐÎÄ
ÁíÍâ, Encode::HanConvert Ä£¿éÔòÌṩÁ˼ò·±×ª»»ÓõÄÁ½ÖÖ±àÂë:
- gbk-trad GBK ¼òÌåÖÐÎÄÓë Unicode ·±ÌåÖÐÎÄ»¥×ª
big5-simp Big5 ·±ÌåÖÐÎÄÓë Unicode ¼òÌåÖÐÎÄ»¥×ª
+ gbk-trad GBK ¼òÌåÖÐÎÄÓë Unicode ·±ÌåÖÐÎÄ»¥×ª
-?ôÏëÔ? GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½
-Ö§³ÌÐò.
+ÈôÏëÔÚ GBK Óë Big5 Ö®¼ä»¥×ª, Çë²Î¿¼¸ÃÄ£¿éÄÚ¸½µÄ b2g.pl Óë g2b.pl Á½Ö§³ÌÐò,
+»òÔÚ³ÌÐòÄÚʹÓÃÏÂÁÐд·¨:
-=head2 ½øÒ»²½µÄ×ÊѶ
+ use Encode::HanConvert;
+ $euc_cn = big5_to_gb($big5); # ´Ó Big5 תΪ GBK
+ $big5 = gb_to_big5($euc_cn); # ´Ó GBK תΪ Big5
-Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îĵµ (²»ÐÒ?«ÊÇÓÃÓ?ÎÄдµÄ) , À´Ñ§Ï°¸ü¶à¹ØÓÚ
+=head2 ½øÒ»²½µÄÐÅÏ¢
+
+Çë²Î¿¼ Perl ÄÚ¸½µÄ´óÁ¿ËµÃ÷Îļþ (²»ÐÒÈ«ÊÇÓÃÓ¢ÎÄдµÄ), À´Ñ§Ï°¸ü¶à¹ØÓÚ
Perl µÄ֪ʶ, ÒÔ¼° Unicode µÄʹÓ÷½Ê½. ²»¹ý, ÍⲿµÄ×ÊÔ´Ï൱·á¸»:
=head2 Ìṩ Perl ×ÊÔ´µÄÍøÖ·
=back
+=head1 SEE ALSO
+
+L<Encode>, L<Encode::CN>, L<encoding>, L<perluniintro>, L<perlunicode>
+
=head1 AUTHORS
Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
-If you read this file _as_is_, just ignore the funny characters you
-see. It is written in the POD format (see perlpod manpage) which is
-specially designed to be readable as is.
-
-This file is in Korean encoded in EUC-KR.
-
-ÀÌ ¹®¼¸¦ perldocÀ» ½á¼ º¸Áö ¾Ê°í Á÷Á¢ º¸´Â °æ¿ì¿¡´Â °¢ ºÎºÐÀÇ
-¿ªÇÒÀ» Ç¥½ÃÇϱâ À§ÇØ ¾²ÀÎ =head, =item, 'L' µîÀº ¹«½ÃÇϽʽÿÀ.
-ÀÌ ¹®¼´Â µû·Î perldocÀ» ¾²Áö ¾Ê°í º¸´õ¶óµµ Àдµ¥ º° ÁöÀåÀÌ
-¾ø´Â POD Çü½ÄÀ¸·Î Â¥¿© ÀÖ½À´Ï´Ù. ´õ ÀÚ¼¼ÇÑ °ÍÀº perlpod
-¸Å´º¾óÀ» Âü°íÇϽʽÿÀ.
-
-
-=head1 NAME
-
-perlko - Perl°ú Çѱ¹¾î ÀÎÄÚµù
-
-=head1 DESCRIPTION
-
-PerlÀÇ ¼¼°è¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù !
-
-Starting for Perl release 5.8.0 Perl has extensive support for Unicode
-and as a part of that, extensive support for non-Latin characters
-encodings, including the CJK (Chinese-Japanese Korean). Unicode is an
-international standard that aims to include all of world's
-characters: Western, Eastern, and everything in between (Greek,
-Cyrillic, Arabic, Hebrew, Indic, Amerindian, and so on), and
-encodings of various operating system platforms (PC and MacIntosh).
-
-PerlÀº 5.8.0 ¹öÀü¿¡¼ºÎÅÍ À¯´ÏÄÚµå/ISO 10646¿¡ ´ëÇÑ ±¤¹üÀ§ÇÑ Áö¿ø ±â´ÉÀ»
-°¡Áö°í ÀÖ½À´Ï´Ù. À¯´ÏÄÚµå Áö¿øÀÇ ÀÏȯÀ¸·Î ÇÑÁßÀÏÀ» ºñ·ÔÇÑ ¼¼°è °¢±¹¿¡¼
-À¯´ÏÄÚµå ÀÌÀü¿¡ ¾²°í ÀÖ¾ú°í Áö±Ýµµ ³Î¸® ¾²ÀÌ°í ÀÖ´Â ¼ö¸¹Àº ÀÎÄÚµùÀ»
-Áö¿øÇÕ´Ï´Ù. À¯´ÏÄÚµå´Â Àü ¼¼°è¿¡¼ ¾²ÀÌ´Â ¸ðµç ¾ð¾î¸¦ À§ÇÑ Ç¥±â ü°è -
-À¯·´ÀÇ ¶óƾ ¾ËÆĺª, Å°¸± ¾ËÆĺª, ±×¸®½º ¾ËÆĺª, Àεµ¿Í µ¿³² ¾Æ½Ã¾ÆÀÇ
-ºê¶ó¹Ì ½ºÅ©¸³Æ® °è¿, ¾Æ¶ø, È÷ºê¸®, ÇÑÁßÀÏÀÇ ÇÑÀÚ, Çѱ¹¾îÀÇ ÇѱÛ,
-ÀϺ»¾îÀÇ °¡³ª, ºÏ¹Ì Àεð¾ÈÀÇ Ç¥±â ü°è µî- ¼ö¿ëÇÏ´Â °ÍÀ» ¸ñÇ¥·Î ÇÏ°í
-Àֱ⠶§¹®¿¡ ±âÁ¸¿¡ ¾²ÀÌ´ø °¢ ¾ð¾î ¹× ±¹°¡ ±×¸®°í ¿î¿µ ü°è¿¡ °íÀ¯ÇÑ
-¹®ÀÚ ÁýÇÕ°ú ÀÎÄÚµùÀ» ¸ðµÎ Æ÷°ýÇÏ°í ÀÖ½À´Ï´Ù.
-
-
-PerlÀº ³»ºÎÀûÀ¸·Î À¯´ÏÄڵ带 ¹®ÀÚ Ç¥ÇöÀ» À§ÇØ »ç¿ëÇÕ´Ï´Ù. º¸´Ù ±¸Ã¼ÀûÀ¸·Î
-¸»Çϸé Perl ½ºÅ©¸³Æ® ¾È¿¡¼ UTF-8 ¹®ÀÚ¿À» ¾µ ¼ö ÀÖ°í,
-°¢Á¾ ÇÔ¼ö¿Í ¿¬»êÀÚ (¿¹¸¦ µé¾î, Á¤±Ô½Ä, index, substr)°¡ ¹ÙÀÌÆ® ´ÜÀ§
-´ë½Å À¯´ÏÄÚµå ±ÛÀÚ ´ÜÀ§·Î µ¿ÀÛÇÕ´Ï´Ù. (´õ ÀÚ¼¼ÇÑ °ÍÀº
-perlunicode ¸Å´º¾óÀ» Âü°íÇϽʽÿÀ.) À¯´ÏÄڵ尡 ³Î¸® º¸±ÞµÇ±â Àü¿¡
-³Î¸® ¾²ÀÌ°í ÀÖ¾ú°í, ¿©ÀüÈ÷ ³Î¸® ¾²ÀÌ°í ÀÖ´Â °¢±¹/°¢ ¾ð¾îº° ÀÎÄÚµùÀ¸·Î
-ÀÔÃâ·ÂÀ» ÇÏ°í À̵é ÀÎÄÚµùÀ¸·Î µÈ µ¥ÀÌÅÍ¿Í ¹®¼¸¦ ´Ù·ç´Â °ÍÀ» µ½±â À§ÇØ
-'Encode'°¡ ¾²¿´½À´Ï´Ù. ¹«¾ùº¸´Ù 'Encode'¸¦ ½á¼ ¼ö¸¹Àº ÀÎÄÚµù »çÀÌÀÇ
-º¯È¯À» ½±°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù.
-
-'Encode'´Â ´ÙÀ½°ú °°Àº Çѱ¹¾î ÀÎÄÚµùÀ» Áö¿øÇÕ´Ï´Ù.
-
- euc-kr : US-ASCII¿Í KS X 1001À» °°ÀÌ ¾²´Â ¸ÖƼ¹ÙÀÌÆ® ÀÎÄÚµù
- (ÈçÈ÷ ¿Ï¼ºÇüÀ̶ó°í ºÒ¸².) KS X 2901°ú RFC 1557 Âü°í.
- cp949 : MS-Windows 9x/ME¿¡¼ ¾²ÀÌ´Â È®Àå ¿Ï¼ºÇü.
- euc-kr¿¡ 8,822ÀÚÀÇ ÇÑ±Û À½ÀýÀ» ´õÇÑ °ÍÀÓ.
- alias´Â uhc, windows-949, x-windows-949,
- ks_c_5601-1987. ¸Ç ¸¶Áö¸· À̸§Àº ÀûÀýÇÏÁö ¾ÊÀº
- À̸§ÀÌÁö¸¸, Microsoft Á¦Ç°¿¡¼ CP949ÀÇ Àǹ̷Î
- ¾²ÀÌ°í ÀÖÀ½.
- johab : KS X 1001:1998 ºÎ·Ï 3¿¡¼ ±ÔÁ¤ÇÑ Á¶ÇÕÇü.
- ¹®ÀÚ ·¹ÆÛÅ丮´Â cp949¿Í ¸¶Âù°¡Áö·Î US-ASCII,
- KS X 1001¿¡ 8,822ÀÚÀÇ ÇÑ±Û À½ÀýÀ» ´õÇÑ °ÍÀÓ.
-
- iso-2022-kr : RFC 1557¿¡¼ ±ÔÁ¤ÇÑ Çѱ¹¾î ÀÎÅÍ³Ý ¸ÞÀÏ ±³È¯¿ë ÀÎÄÚµùÀ¸·Î
- US-ASCII¿Í KS X 1001À» ·¹ÆÛÅ丮·Î ÇÏ´Â Á¡¿¡¼
- euc-kr°ú °°Áö¸¸ ÀÎÄÚµù ¹æ½ÄÀÌ ´Ù¸§.
- 1997-8³â °æ±îÁö ¾²¿´À¸³ª ´õ ÀÌ»ó ¸ÞÀÏ ±³È¯¿¡ ¾²ÀÌÁö
- ¾ÊÀ½.
- ksc5601-raw : KS X 1001(KS C 5601)À» GL(Áï, MSB¸¦ 0À¸·Î ÇÑ °æ¿ì)
- ¿¡ ³õ¾ÒÀ» ¶§ÀÇ ÀÎÄÚµù. US-ASCII¿Í °áÇÕÇÏÁö ¾Ê°í
- ´Üµ¶À¸·Î ¾²ÀÌ´Â ÀÏÀº X11 µî¿¡¼ ±Û²Ã ÀÎÄÚµù
- (ksc5601.1987-0. '0'Àº GLÀ» ÀǹÌÇÔ.)À¸·Î ¾²ÀÌ´Â °ÍÀ»
- Á¦¿ÜÇÏ°í´Â °ÅÀÇ ¾øÀ½.
-
-¿¹¸¦ µé¾î, euc-kr ÀÎÄÚµùÀ¸·Î µÈ ÆÄÀÏÀ» UTF-8·Î º¯È¯ÇÏ·Á¸é ´ÙÀ½°ú
-°°ÀÌ ÇÏ¸é µË´Ï´Ù.
-
-
- perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euckr > file.utf8
-
-¿ªº¯È¯Àº ´ÙÀ½°ú °°ÀÌ ÇÒ ¼ö ÀÖ½À´Ï´Ù.
-
- perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euckr
-
-ÀÌ·± º¯È¯À» Á»´õ Æí¸®ÇÏ°Ô ÇÒ ¼ö ÀÖµµ·Ï Encode ¸ðµâÀ» ½á¼
-¼ø¼öÇÏ°Ô Perl·Î¸¸ ¾²ÀÎ piconv°¡ Perl¿¡ µé¾î ÀÖ½À´Ï´Ù.
-±× À̸§¿¡¼ ¾Ë ¼ö ÀÖµíÀÌ piconv´Â Unix¿¡ ÀÖ´Â iconv¸¦
-¸ðµ¨·Î ÇÑ °ÍÀÔ´Ï´Ù. ±× »ç¿ë¹ýÀº ¾Æ·¡¿Í °°½À´Ï´Ù.
-
- piconv -f FOO -t utf8 < file.euckr > file.utf8
- piconv -f utf8 -t FOO < file.utf8 > file.euckr
-
-¶Ç, 'encoding' ¸ðµâÀ» ½á¼ Çѱ¹¾î ÀÎÄÚµùÀ» ¾²¸é¼ ±ÛÀÚ ´ÜÀ§
-(¹ÙÀÌÆ® ´ÜÀ§°¡ ¾Æ´Ï¶ó) 󸮸¦ ½±°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù.
-
- #!/usr/local/bin/perl
-
- use encoding 'euc-kr', STDIN => 'euc-kr',
- STDOUT-> 'euc-kr', STDERR=>'euc-kr';
-
- print length("°¡³ª"); # 2 (Å« µû¿ÈÇ¥´Â ±ÛÀÚ ´ÜÀ§ 󸮸¦ Áö½Ã)
- print length('°¡³ª'); # 4 (ÀÛÀº µû¿ÈÇ¥´Â ¹ÙÀÌÆ® ´ÜÀ§ 󸮸¦ Áö½Ã)
- print index("ÇÑ°, ´ëµ¿°", "¿°"); # -1 ('¿°'ÀÌ ¾øÀ½)
- print index('ÇÑ°, ´ëµ¿°', '¿°'); # 7 (8¹ø°¿Í 9¹ø° ¹ÙÀÌÆ®°¡ '¿°'ÀÇ
- Äڵ尪°ú ÀÏÄ¡ÇÔ.)
-
-
-=head2 ´õ ÀÚ¼¼È÷ ¾Ë°í ½ÍÀ¸¸é...
-
-PerlÀ» ¼³Ä¡ÇÏ¸é ´ë´ÜÈ÷ ÀÚ¼¼ÇÑ ¹®¼°¡ °°ÀÌ µû¶ó ¿À¸ç, ÀÌ ¹®¼¸¦ ÅëÇØ
-Perl Àü¹Ý »Ó ¾Æ´Ï¶ó À¯´ÏÄÚµå Áö¿ø, EncodeÀÇ »ç¿ë¹ý µî¿¡ ¸¹Àº °ÍÀ»
-¹è¿ï ¼ö ÀÖ½À´Ï´Ù. ºÒÇàÈ÷µµ ÀÌ ¹®¼´Â ÇöÀç ¸ðµÎ ¿µ¾î·Î ¾²¿© ÀÖ½À´Ï´Ù.
-ÀÌ ¹®¼ ¿Ü¿¡µµ ´ÙÀ½°ú °°Àº ÀÚ·á°¡ ÀÖ½À´Ï´Ù. ÀÌ ¸ñ·ÏÀº °áÄÚ
-¿ÏÀüÇÑ °ÍÀÌ ¾Æ´Ï°í ÀϺΠ´ëÇ¥ÀûÀÎ °Í¸¸ ¸ðÀº °ÍÀÔ´Ï´Ù.
-
-
-=head2 Perl °ü·Ã ÀÚ·á
-
-=over 4
-
-=item L<http://www.perl.com/>
-
- O'ReillyÀÇ Perl À¥ ÆäÀÌÁö
-
-=item L<http://www.cpan.org/>
-
- Comprehensive Perl Archive Network
-
-=item L<http://lists.perl.org/>
-
- Perl ¸ÞÀϸµ ¸®½ºÆ®. ¸¹Àº ¸®½ºÆ® °¡¿îµ¥
- perl-unicode¿¡¼ 'Encode'¿¡ ´ëÇØ ³íÀÇÇÔ.
-
-=back
-
-=head2 PerlÀ» ´õ ±í°Ô °øºÎÇϴµ¥ µµ¿òÀ» ÁÙ ¼ö ÀÖ´Â Çѱ¹¾î °ü·Ã »çÀÌÆ®
-
-=over 4
-
-=item L<http://www.oreilly.co.kr/perl/>
-
- O'Reilly¿¡¼ ³ª¿Â Çѱ¹¾î Perl ¼Àû ¸ñ·Ï
-
-=item L<http://www.perl.co.kr>
-
- Perl¿¡ °ü·ÃµÈ CGI, DB, ¿¬µ¿ µî¿¡ ´ëÇÑ Á¤º¸ ¹× ´º½º Á¦°ø
-
-=back
-
-=head2 À¯´ÏÄÚµå °ü·Ã ÀÚ·á
-
-=over 4
-
-=item L<http://www.unicode.org/>
-
- À¯´ÏÄÚµå ÄÁ¼Ò½Ã¾ö.
-
-=item L<http://std.dkuug.dk/JTC1/SC2/WG2>
-
-±âº»ÀûÀ¸·Î Unicode¿Í °°Àº ISO Ç¥ÁØÀÎ ISO/IEC 10646 UCS(Universal
-Character Set)À» ¸¸µå´Â ISO/IEC JTC1/SC2/WG2ÀÇ À¥ ÆäÀÌÁö.
-
-=item L<htp://www.cl.cam.ac.uk/~mgk25/unicode.html>
-
- À¯´Ð½º/¸®´ª½º¿¡¼ À¯´ÏÄÚµå¿Í UTF-8 »ç¿ë¿¡ ´ëÇÑ ¹®´äÁý(FAQ)
-
-=item L<http://kldp.org/Translations/html/UTF8-Unicode-KLDP/UTF8-Unicode-KLDP.html>
-
- À¯´Ð½º/¸®´ª½º¿¡¼ À¯´ÏÄÚµå¿Í UTF-8 »ç¿ë¿¡ ´ëÇÑ ¹®´äÁý(FAQ)ÀÇ Çѱ¹¾î ¹ø¿ª
-
-=back
-
-=head1 AUTHORS
-
-Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>
-½ÅÁ¤½Ä E<lt>jshin@mailaps.org<gt>
-
-=cut
+If you read this file _as_is_, just ignore the funny characters you\r
+see. It is written in the POD format (see perlpod manpage) which is\r
+specially designed to be readable as is.\r
+\r
+This file is in Korean encoded in EUC-KR. \r
+\r
+ÀÌ ¹®¼¸¦ perldocÀ» ½á¼ º¸Áö ¾Ê°í Á÷Á¢ º¸´Â °æ¿ì¿¡´Â °¢ ºÎºÐÀÇ\r
+¿ªÇÒÀ» Ç¥½ÃÇϱâ À§ÇØ ¾²ÀÎ =head, =item, 'L' µîÀº ¹«½ÃÇϽʽÿÀ.\r
+ÀÌ ¹®¼´Â µû·Î perldocÀ» ¾²Áö ¾Ê°í º¸´õ¶óµµ Àдµ¥ º° ÁöÀåÀÌ\r
+¾ø´Â POD Çü½ÄÀ¸·Î Â¥¿© ÀÖ½À´Ï´Ù. ´õ ÀÚ¼¼ÇÑ °ÍÀº perlpod\r
+¸Å´º¾óÀ» Âü°íÇϽʽÿÀ. \r
+\r
+\r
+=head1 NAME\r
+\r
+perlko - Perl°ú Çѱ¹¾î ÀÎÄÚµù\r
+\r
+=head1 DESCRIPTION\r
+\r
+PerlÀÇ ¼¼°è¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù !\r
+\r
+\r
+PerlÀº 5.8.0ÆǺÎÅÍ À¯´ÏÄÚµå/ISO 10646¿¡ ´ëÇÑ ±¤¹üÀ§ÇÑ Áö¿øÀ» ÇÕ´Ï´Ù.\r
+À¯´ÏÄÚµå Áö¿øÀÇ ÀÏȯÀ¸·Î ÇÑÁßÀÏÀ» ºñ·ÔÇÑ ¼¼°è °¢±¹¿¡¼\r
+À¯´ÏÄÚµå ÀÌÀü¿¡ ¾²°í ÀÖ¾ú°í Áö±Ýµµ ³Î¸® ¾²ÀÌ°í ÀÖ´Â ¼ö¸¹Àº ÀÎÄÚµùÀ»\r
+Áö¿øÇÕ´Ï´Ù. À¯´ÏÄÚµå´Â Àü ¼¼°è¿¡¼ ¾²ÀÌ´Â ¸ðµç ¾ð¾î¸¦ À§ÇÑ Ç¥±â ü°è -\r
+À¯·´ÀÇ ¶óƾ ¾ËÆĺª, Å°¸± ¾ËÆĺª, ±×¸®½º ¾ËÆĺª, Àεµ¿Í µ¿³² ¾Æ½Ã¾ÆÀÇ\r
+ºê¶ó¹Ì °è¿ ½ºÅ©¸³Æ®, ¾Æ¶ø ¹®ÀÚ, È÷ºê¸® ¹®ÀÚ, ÇÑÁßÀÏÀÇ ÇÑÀÚ, Çѱ¹¾îÀÇ ÇѱÛ,\r
+ÀϺ»¾îÀÇ °¡³ª, ºÏ¹Ì Àεð¾ÈÀÇ Ç¥±â ü°è µî- ¼ö¿ëÇÏ´Â °ÍÀ» ¸ñÇ¥·Î ÇÏ°í\r
+Àֱ⠶§¹®¿¡ ±âÁ¸¿¡ ¾²ÀÌ´ø °¢ ¾ð¾î ¹× ±¹°¡ ±×¸®°í ¿î¿µ ü°è¿¡ °íÀ¯ÇÑ\r
+¹®ÀÚ ÁýÇÕ°ú ÀÎÄÚµùÀ» ¸ðµÎ Æ÷°ýÇÏ°í ÀÖ½À´Ï´Ù.\r
+\r
+\r
+PerlÀº ³»ºÎÀûÀ¸·Î À¯´ÏÄڵ带 ¹®ÀÚ Ç¥ÇöÀ» À§ÇØ »ç¿ëÇÕ´Ï´Ù. º¸´Ù ±¸Ã¼ÀûÀ¸·Î\r
+¸»Çϸé Perl ½ºÅ©¸³Æ® ¾È¿¡¼ UTF-8 ¹®ÀÚ¿À» ¾µ ¼ö ÀÖ°í, \r
+°¢Á¾ ÇÔ¼ö¿Í ¿¬»êÀÚ(¿¹¸¦ µé¾î, Á¤±Ô½Ä, index, substr)°¡ ¹ÙÀÌÆ® ´ÜÀ§\r
+´ë½Å À¯´ÏÄÚµå ±ÛÀÚ ´ÜÀ§·Î µ¿ÀÛÇÕ´Ï´Ù. (´õ ÀÚ¼¼ÇÑ °ÍÀº \r
+perlunicode ¸Å´º¾óÀ» Âü°íÇϽʽÿÀ.) À¯´ÏÄڵ尡 ³Î¸® º¸±ÞµÇ±â Àü¿¡\r
+³Î¸® ¾²ÀÌ°í ÀÖ¾ú°í, ¿©ÀüÈ÷ ³Î¸® ¾²ÀÌ°í ÀÖ´Â °¢±¹/°¢ ¾ð¾îº° ÀÎÄÚµùÀ¸·Î\r
+ÀÔÃâ·ÂÀ» ÇÏ°í À̵é ÀÎÄÚµùÀ¸·Î µÈ µ¥ÀÌÅÍ¿Í ¹®¼¸¦ ´Ù·ç´Â °ÍÀ» µ½±â À§ÇØ\r
+'Encode'°¡ ¾²¿´½À´Ï´Ù. ¹«¾ùº¸´Ù 'Encode'¸¦ ½á¼ ¼ö¸¹Àº ÀÎÄÚµù »çÀÌÀÇ\r
+º¯È¯À» ½±°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù.\r
+\r
+'Encode'´Â ´ÙÀ½°ú °°Àº Çѱ¹¾î ÀÎÄÚµùÀ» Áö¿øÇÕ´Ï´Ù.\r
+\r
+ euc-kr : US-ASCII¿Í KS X 1001À» °°ÀÌ ¾²´Â ¸ÖƼ¹ÙÀÌÆ® ÀÎÄÚµù\r
+ (ÈçÈ÷ ¿Ï¼ºÇüÀ̶ó°í ºÒ¸².) KS X 2901°ú RFC 1557 Âü°í.\r
+ cp949 : MS-Windows 9x/ME¿¡¼ ¾²ÀÌ´Â È®Àå ¿Ï¼ºÇü. \r
+ euc-kr¿¡ 8,822ÀÚÀÇ ÇÑ±Û À½ÀýÀ» ´õÇÑ °ÍÀÓ. \r
+ alias´Â uhc, windows-949, x-windows-949,\r
+ ks_c_5601-1987. ¸Ç ¸¶Áö¸· À̸§Àº ÀûÀýÇÏÁö ¾ÊÀº\r
+ À̸§ÀÌÁö¸¸, Microsoft Á¦Ç°¿¡¼ CP949ÀÇ Àǹ̷Î\r
+ ¾²ÀÌ°í ÀÖÀ½.\r
+ johab : KS X 1001:1998 ºÎ·Ï 3¿¡¼ ±ÔÁ¤ÇÑ Á¶ÇÕÇü.\r
+ ¹®ÀÚ ·¹ÆÛÅ丮´Â cp949¿Í ¸¶Âù°¡Áö·Î US-ASCII,\r
+ KS X 1001¿¡ 8,822ÀÚÀÇ ÇÑ±Û À½ÀýÀ» ´õÇÑ °ÍÀÓ.\r
+\r
+ iso-2022-kr : RFC 1557¿¡¼ ±ÔÁ¤ÇÑ Çѱ¹¾î ÀÎÅÍ³Ý ¸ÞÀÏ ±³È¯¿ë ÀÎÄÚµùÀ¸·Î\r
+ US-ASCII¿Í KS X 1001À» ·¹ÆÛÅ丮·Î ÇÏ´Â Á¡¿¡¼\r
+ euc-kr°ú °°Áö¸¸ ÀÎÄÚµù ¹æ½ÄÀÌ ´Ù¸§. \r
+ 1997-8³â °æ±îÁö ¾²¿´À¸³ª ´õ ÀÌ»ó ¸ÞÀÏ ±³È¯¿¡ ¾²ÀÌÁö\r
+ ¾ÊÀ½.\r
+ ksc5601-raw : KS X 1001(KS C 5601)À» GL(Áï, MSB¸¦ 0À¸·Î ÇÑ °æ¿ì)\r
+ ¿¡ ³õ¾ÒÀ» ¶§ÀÇ ÀÎÄÚµù. US-ASCII¿Í °áÇÕÇÏÁö ¾Ê°í\r
+ ´Üµ¶À¸·Î ¾²ÀÌ´Â ÀÏÀº X11 µî¿¡¼ ±Û²Ã ÀÎÄÚµù\r
+ (ksc5601.1987-0. '0'Àº GLÀ» ÀǹÌÇÔ.)À¸·Î ¾²ÀÌ´Â °ÍÀ» \r
+ Á¦¿ÜÇÏ°í´Â °ÅÀÇ ¾øÀ½.\r
+\r
+¿¹¸¦ µé¾î, euc-kr ÀÎÄÚµùÀ¸·Î µÈ ÆÄÀÏÀ» UTF-8·Î º¯È¯ÇÏ·Á¸é ´ÙÀ½°ú\r
+°°ÀÌ ÇÏ¸é µË´Ï´Ù. \r
+\r
+\r
+ perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euckr > file.utf8\r
+\r
+¿ªº¯È¯Àº ´ÙÀ½°ú °°ÀÌ ÇÒ ¼ö ÀÖ½À´Ï´Ù. \r
+\r
+ perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euckr\r
+\r
+ÀÌ·± º¯È¯À» Á»´õ Æí¸®ÇÏ°Ô ÇÒ ¼ö ÀÖµµ·Ï Encode ¸ðµâÀ» ½á¼ \r
+¼ø¼öÇÏ°Ô Perl·Î¸¸ ¾²ÀÎ piconv°¡ Perl¿¡ µé¾î ÀÖ½À´Ï´Ù.\r
+±× À̸§¿¡¼ ¾Ë ¼ö ÀÖµíÀÌ piconv´Â Unix¿¡ ÀÖ´Â iconv¸¦\r
+¸ðµ¨·Î ÇÑ °ÍÀÔ´Ï´Ù. ±× »ç¿ë¹ýÀº ¾Æ·¡¿Í °°½À´Ï´Ù.\r
+\r
+ piconv -f euc-kr -t utf8 < file.euckr > file.utf8\r
+ piconv -f utf8 -t euc-kr < file.utf8 > file.euckr\r
+\r
+¶Ç, 'encoding' ¸ðµâÀ» ½á¼ Çѱ¹¾î ÀÎÄÚµùÀ» ¾²¸é¼ ±ÛÀÚ ´ÜÀ§\r
+(¹ÙÀÌÆ® ´ÜÀ§°¡ ¾Æ´Ï¶ó) 󸮸¦ ½±°Ô ÇÒ ¼ö ÀÖ½À´Ï´Ù.\r
+\r
+ #!/usr/local/bin/perl \r
+\r
+ use encoding 'euc-kr', STDIN => 'euc-kr',\r
+ STDOUT-> 'euc-kr', STDERR=>'euc-kr';\r
+\r
+ print length("°¡³ª"); # 2 (Å« µû¿ÈÇ¥´Â ±ÛÀÚ ´ÜÀ§ 󸮸¦ Áö½Ã)\r
+ print length('°¡³ª'); # 4 (ÀÛÀº µû¿ÈÇ¥´Â ¹ÙÀÌÆ® ´ÜÀ§ 󸮸¦ Áö½Ã)\r
+ print index("ÇÑ°, ´ëµ¿°", "¿°"); # -1 ('¿°'ÀÌ ¾øÀ½)\r
+ print index('ÇÑ°, ´ëµ¿°', '¿°'); # 7 (8¹ø°¿Í 9¹ø° ¹ÙÀÌÆ®°¡ '¿°'ÀÇ\r
+ Äڵ尪°ú ÀÏÄ¡ÇÔ.)\r
+\r
+\r
+=head2 ´õ ÀÚ¼¼È÷ ¾Ë°í ½ÍÀ¸¸é...\r
+\r
+PerlÀ» ¼³Ä¡ÇÏ¸é ´ë´ÜÈ÷ ÀÚ¼¼ÇÑ ¹®¼°¡ °°ÀÌ µû¶ó ¿À¸ç, ÀÌ ¹®¼¸¦ ÅëÇØ\r
+Perl Àü¹Ý »Ó ¾Æ´Ï¶ó À¯´ÏÄÚµå Áö¿ø, EncodeÀÇ »ç¿ë¹ý µî¿¡ ¸¹Àº °ÍÀ»\r
+¹è¿ï ¼ö ÀÖ½À´Ï´Ù. ºÒÇàÈ÷µµ ÀÌ ¹®¼´Â ÇöÀç ¸ðµÎ ¿µ¾î·Î ¾²¿© ÀÖ½À´Ï´Ù.\r
+ÀÌ ¹®¼ ¿Ü¿¡µµ ´ÙÀ½°ú °°Àº ÀÚ·á°¡ ÀÖ½À´Ï´Ù. ÀÌ ¸ñ·ÏÀº °áÄÚ\r
+¿ÏÀüÇÑ °ÍÀÌ ¾Æ´Ï°í ÀϺΠ´ëÇ¥ÀûÀÎ °Í¸¸ ¸ðÀº °ÍÀÔ´Ï´Ù.\r
+\r
+\r
+=head2 Perl °ü·Ã ÀÚ·á\r
+\r
+=over 4\r
+\r
+=item L<http://www.perl.com/> \r
+\r
+ O'ReillyÀÇ Perl À¥ ÆäÀÌÁö \r
+\r
+=item L<http://www.cpan.org/>\r
+\r
+ Comprehensive Perl Archive Network\r
+\r
+=item L<http://lists.perl.org/> \r
+\r
+ Perl ¸ÞÀϸµ ¸®½ºÆ®. ¸¹Àº ¸®½ºÆ® °¡¿îµ¥\r
+ perl-unicode¿¡¼ 'Encode'¿¡ ´ëÇØ ³íÀÇÇÔ.\r
+\r
+=back\r
+\r
+=head2 PerlÀ» ´õ ±í°Ô °øºÎÇϴµ¥ µµ¿òÀ» ÁÙ ¼ö ÀÖ´Â Çѱ¹¾î °ü·Ã »çÀÌÆ®\r
+\r
+=over 4\r
+\r
+=item L<http://www.perl.or.kr/>\r
+\r
+ Perl Çѱ¹ »ç¿ëÀÚ ¸ðÀÓ \r
+\r
+=item L<news:han.comp.lang.perl/>\r
+\r
+ Çѱ¹¾î Perl ´º½º ±×·ì\r
+\r
+=item L<http://seoul.pm.org/>\r
+\r
+ Perl ¸Á°Å½º (¼¿ï)\r
+\r
+=item L<http://www.perlmania.or.kr/>\r
+\r
+ Home for Korean Perlmanias\r
+\r
+=item L<http://www.oreilly.co.kr/perl/>\r
+ \r
+ O'Reilly¿¡¼ ³ª¿Â Çѱ¹¾î Perl ¼Àû ¸ñ·Ï\r
+\r
+=item L<http://www.perlschool.net/>\r
+\r
+ Perl ±âÃÊ °Á ¹× ¼Ò½º, ÃÖ±Ù µ¿Çâ, °ü·Ã ÇØ¿Ü »çÀÌÆ® ¸µÅ© \r
+\r
+=item L<http://www.perl.co.kr>\r
+\r
+ Perl¿¡ °ü·ÃµÈ CGI, DB, ¿¬µ¿ µî¿¡ ´ëÇÑ Á¤º¸ ¹× ´º½º Á¦°ø\r
+\r
+=back \r
+\r
+=head2 À¯´ÏÄÚµå °ü·Ã ÀÚ·á\r
+\r
+=over 4\r
+\r
+=item L<http://www.unicode.org/>\r
+\r
+ À¯´ÏÄÚµå ÄÁ¼Ò½Ã¾ö. \r
+\r
+=item L<http://std.dkuug.dk/JTC1/SC2/WG2>\r
+\r
+±âº»ÀûÀ¸·Î Unicode¿Í °°Àº ISO Ç¥ÁØÀÎ ISO/IEC 10646 UCS(Universal\r
+Character Set)À» ¸¸µå´Â ISO/IEC JTC1/SC2/WG2ÀÇ À¥ ÆäÀÌÁö. \r
+\r
+=item L<htp://www.cl.cam.ac.uk/~mgk25/unicode.html>\r
+\r
+ À¯´Ð½º/¸®´ª½º¿¡¼ À¯´ÏÄÚµå¿Í UTF-8 »ç¿ë¿¡ ´ëÇÑ ¹®´äÁý(FAQ)\r
+\r
+=item L<http://kldp.org/Translations/html/UTF8-Unicode-KLDP/UTF8-Unicode-KLDP.html>\r
+\r
+ À¯´Ð½º/¸®´ª½º¿¡¼ À¯´ÏÄÚµå¿Í UTF-8 »ç¿ë¿¡ ´ëÇÑ ¹®´äÁý(FAQ)ÀÇ Çѱ¹¾î ¹ø¿ª\r
+\r
+=back\r
+\r
+=head1 AUTHORS\r
+\r
+Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>\r
+½ÅÁ¤½Ä E<lt>jshin@mailaps.org<gt>\r
+\r
+=cut\r
The following documentation is written in Big5 encoding.
-¦pªG§A¥Î¤@¯ëªº¤å¦r½s¿è¾¹¾\Äý³o¥÷¤å¥ó, ½Ð©¿²¤¤å¤¤©_¯Sªºµù°O¦r²Å. ³o¥÷¤å
-¥ó¬O¥H POD (²©ú¤å¥ó®æ¦¡) ¼g¦¨; ³oºØ®æ¦¡¬O¬°¤F¯àÅý¤Hª½±µÅª¨ú¦Ó¯S§O³]p
-ªº. Ãö©ó¦¹®æ¦¡ªº¶i¤@¨B¸ê°T, ½Ð°Ñ¦Ò perlpod ½u¤W¤å¥ó.
+¦pªG§A¥Î¤@¯ëªº¤å¦r½s¿è¾¹¾\Äý³o¥÷¤å¥ó, ½Ð©¿²¤¤å¤¤©_¯Sªºµù°O¦r²Å.
+³o¥÷¤å¥ó¬O¥H POD (²©ú¤å¥ó®æ¦¡) ¼g¦¨; ³oºØ®æ¦¡¬O¬°¤F¯àÅý¤Hª½±µÅª¨ú,
+¦Ó¯S§O³]pªº. Ãö©ó¦¹®æ¦¡ªº¶i¤@¨B¸ê°T, ½Ð°Ñ¦Ò perlpod ½u¤W¤å¥ó.
=head1 NAME
Åwªï¨Ó¨ì Perl ªº¤Ñ¦a!
-±q 5.8.0 ª©¶}©l, Perl ¨ã³Æ¤F¸ÔºÉªº Unicode (¸U°ê½X) ¤ä´©, ¤]³s±a¤ä´©¤F
-³\¦h©Ô¤B»y¨t¥H¥~ªº½s½X¤è¦¡; CJK (¤¤¤éÁú) «K¬O¨ä¤¤ªº¤@³¡¥÷. Unicode ¬O
-°ê»Ú©Êªº¼Ð·Ç, ¸Õ¹Ï²[»\¥@¬É¤W©Ò¦³ªº¦r²Å: ¦è¤è¥@¬É, ªF¤è¥@¬É, ¥H¤Î¨âªÌ¶¡
-ªº¤@¤Á (§Æþ¤å, ±Ô§Q¨È¤å, ªü©Ô§B¤å, §Æ§B¨Ó¤å, ¦L«×¤å, ¦L¦a¦w¤å, µ¥µ¥).
-¥¦¤]®e¯Ç¤F¦hºØ§@·~¨t²Î»P¥»O (¦p PC ¤Î³Áª÷¶ð).
+±q 5.8.0 ª©¶}©l, Perl ¨ã³Æ¤F§¹µ½ªº Unicode (¸U°ê½X) ¤ä´©,
+¤]³s±a¤ä´©¤F³\¦h©Ô¤B»y¨t¥H¥~ªº½s½X¤è¦¡; CJK (¤¤¤éÁú) «K¬O¨ä¤¤ªº¤@³¡¥÷.
+Unicode ¬O°ê»Ú©Êªº¼Ð·Ç, ¸Õ¹Ï²[»\¥@¬É¤W©Ò¦³ªº¦r²Å: ¦è¤è¥@¬É, ªF¤è¥@¬É,
+¥H¤Î¨âªÌ¶¡ªº¤@¤Á (§Æþ¤å, ±Ô§Q¨È¤å, ªü©Ô§B¤å, §Æ§B¨Ó¤å, ¦L«×¤å,
+¦L¦a¦w¤å, µ¥µ¥). ¥¦¤]®e¯Ç¤F¦hºØ§@·~¨t²Î»P¥»O (¦p PC ¤Î³Áª÷¶ð).
Perl ¥»¨¥H Unicode ¶i¦æ¾Þ§@. ³oªí¥Ü Perl ¤º³¡ªº¦r¦ê¸ê®Æ¥i¥Î Unicode
-ªí¥Ü, Perl ªº¨ç¦¡»Pºâ²Å (¨Ò¦p¥¿³Wªí¥Ü¦¡¤ñ¹ï) ¤]¯à¹ï Unicode ¶i¦æ¾Þ§@.
-¦b¿é¤J¤Î¿é¥X®É, ¬°¤F³B²z¥H Unicode ¤§«eªº½s½X¤è¦¡Àx¦sªº¸ê®Æ, Perl ´£¨Ñ
-¤F¡uEncode¡v³oÓ¼Ò²Õ, ¥i¥HÅý§A»´©ö¦aŪ¨ú¤Î¼g¤J¦³ªº½s½X¸ê®Æ.
+ªí¥Ü; Perl ªº¨ç¦¡»Pºâ²Å (¨Ò¦p¥¿³Wªí¥Ü¦¡¤ñ¹ï) ¤]¯à¹ï Unicode ¶i¦æ¾Þ§@.
+¦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¤è¦¡:
- big5 ³Ìªìªº Big5 ½s½X
+ big5 ì©lªº Big5 ½s½X (§tʤѤé¤å¦r§Î)
big5-hkscs Big5 + »´ä¥~¦r¶°
cp950 ¦r½X¶ 950 (Big5 + ·L³n²K¥[ªº¦r²Å)
perl -Mencoding=big5,STDOUT,utf8 -pe1 < file.big5 > file.utf8
-Perl ¤]¤ºªþ¤F¡upiconv¡v, ¤@¤ä§¹¥þ¥H Perl ¼g¦¨ªº¦r²ÅÂà´«¤u¨ãµ{¦¡, ¥Îªk
-¦p¤U:
+Perl ¤]¤ºªþ¤F "piconv", ¤@¤ä§¹¥þ¥H Perl ¼g¦¨ªº¦r²ÅÂà´«¤u¨ãµ{¦¡, ¥Îªk¦p¤U:
piconv -f big5 -t utf8 < file.big5 > file.utf8
piconv -f utf8 -t big5 < file.utf8 > file.big5
#!/usr/bin/env perl
# ±Ò°Ê big5 ¦r¦ê¸ÑªR; ¼Ð·Ç¿é¥X¤J¤Î¼Ð·Ç¿ù»~³£³]¬° big5 ½s½X
- use encoding 'big5', STDIN => 'big5',
- STDOUT => 'big5', STDERR => 'big5';
-
+ use encoding 'big5', STDIN => 'big5', STDOUT => 'big5';
print length("Àd¾m"); # 2 (Âù¤Þ¸¹ªí¥Ü¦r²Å)
print length('Àd¾m'); # 4 (³æ¤Þ¸¹ªí¥Ü¦ì¤¸²Õ)
print index("½Î½Î±Ð»£", "να"); # -1 (¤£¥]§t¦¹¤l¦r¦ê)
- print index('½Î½Î±Ð»£', 'να'); # 1 (±q²Ä¤GÓ¦r¸`¶}©l)
+ print index('½Î½Î±Ð»£', 'να'); # 1 (±q²Ä¤GӦ줸²Õ¶}©l)
+
+¦b³Ì«á¤@¦C¨Ò¤l¸Ì, "½Î" ªº²Ä¤GӦ줸²Õ»P "½Î" ªº²Ä¤@Ӧ줸²Õµ²¦X¦¨ Big5
+½Xªº "ν"; "½Î" ªº²Ä¤GӦ줸²Õ«h»P "±Ð" ªº²Ä¤@Ӧ줸²Õµ²¦X¦¨ "α".
+³o¸Ñ¨M¤F¥H«e Big5 ½X¤ñ¹ï³B²z¤W±`¨£ªº°ÝÃD.
=head2 ÃB¥~ªº¤¤¤å½s½X
¥t¥~, Encode::HanConvert ¼Ò²Õ«h´£¨Ñ¤F²ÁcÂà´«¥Îªº¨âºØ½s½X:
big5-simp Big5 ¥¿Å餤¤å»P Unicode ²Å餤¤å¤¬Âà
- gbk-trad GBK ²Å餤¤å»P Unicode ÁcÅ餤¤å¤¬Âà
+ gbk-trad GBK ²Å餤¤å»P Unicode ¥¿Å餤¤å¤¬Âà
+
+Y·Q¦b GBK »P Big5 ¤§¶¡¤¬Âà, ½Ð°Ñ¦Ò¸Ó¼Ò²Õ¤ºªþªº b2g.pl »P g2b.pl ¨â¤äµ{¦¡,
+©Î¦bµ{¦¡¤º¨Ï¥Î¤U¦C¼gªk:
-Y·Q¦b GBK »P Big5 ¤§¶¡¤¬Âà, ½Ð°Ñ¦Ò¸Ó¼Ò²Õ¤ºªþªº b2g.pl »P g2b.pl ¨â
-¤äµ{¦¡.
+ use Encode::HanConvert;
+ $euc_cn = big5_to_gb($big5); # ±q Big5 Âର GBK
+ $big5 = gb_to_big5($euc_cn); # ±q GBK Âର Big5
=head2 ¶i¤@¨Bªº¸ê°T
-½Ð°Ñ¦Ò Perl ¤ºªþªº¤j¶q»¡©ú¤å¥ó (¤£©¯¥þ¬O¥Î^¤å¼gªº) , ¨Ó¾Ç²ß§ó¦hÃö©ó
+½Ð°Ñ¦Ò Perl ¤ºªþªº¤j¶q»¡©ú¤å¥ó (¤£©¯¥þ¬O¥Î^¤å¼gªº), ¨Ó¾Ç²ß§ó¦hÃö©ó
Perl ªºª¾ÃÑ, ¥H¤Î Unicode ªº¨Ï¥Î¤è¦¡. ¤£¹L, ¥~³¡ªº¸ê·½¬Û·íÂ×´I:
=head2 ´£¨Ñ Perl ¸ê·½ªººô§}
Unix/Linux ¤Wªº UTF-8 ¤Î Unicode µª«È°Ý
+=head2 ¤¤¤å¤Æ¸ê°T
+
+=item ¬°¤°»ò¥s "¥¿Å餤¤å" ¤£¥s "ÁcÅ餤¤å"?
+
+L<http://www.csie.ntu.edu.tw/~b7506051/mozilla/faq.html#faqglossary>
+
+=item ¤¤¤å¤Æ³nÅéÁp·ù
+
+L<http://www.cpatch.org/>
+
+=item Linux ³nÅ餤¤å¤Æp¹º
+
+L<http://www.linux.org.tw/CLDP/>
+
=back
+=head1 SEE ALSO
+
+L<Encode>, L<Encode::TW>, L<encoding>, L<perluniintro>, L<perlunicode>
+
=head1 AUTHORS
Jarkko Hietaniemi E<lt>jhi@iki.fiE<gt>