Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.9k stars 540 forks source link

Our Asian documentation should be updated #12931

Closed p5pRT closed 10 years ago

p5pRT commented 11 years ago

Migrated from rt.perl.org#117765 (status was 'resolved')

Searchable as RT117765$

p5pRT commented 11 years ago

From @Leont

This is a bug report for perl from fawaka@​gmail.com\, generated with the help of perlbug 1.39 running under perl 5.16.1.


I recently took the liberty to convert our asian readme files from euc-* to utf-8\, but I didn't update their contents. I can't understand them\, but they still seem to advocate «use encoding». Someone who actually groks the languages should probably update their content.



Flags​:   category=docs   severity=low


Site configuration information for perl 5.16.1​:

Configured by leon at Thu Aug 9 12​:30​:13 EEST 2012.

Summary of my perl5 (revision 5 version 16 subversion 1) configuration​:

  Platform​:   osname=linux\, osvers=3.2.0-27-generic\, archname=x86_64-linux-thread-multi   uname='linux leon-laptop 3.2.0-27-generic #43-ubuntu smp fri jul 6 14​:25​:57 utc 2012 x86_64 x86_64 x86_64 gnulinux '   config_args='-de -Dprefix=/home/leon/perl5/perlbrew/perls/perl-5.16.1 -Duseshrplib -Dusethreads'   hint=recommended\, useposix=true\, d_sigaction=define   useithreads=define\, usemultiplicity=define   useperlio=define\, d_sfio=undef\, uselargefiles=define\, usesocks=undef   use64bitint=define\, use64bitall=define\, uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='cc'\, ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'\,   optimize='-O2'\,   cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'   ccversion=''\, gccversion='4.6.3'\, gccosandvers=''   intsize=4\, longsize=8\, ptrsize=8\, doublesize=8\, byteorder=12345678   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16   ivtype='long'\, ivsize=8\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='cc'\, ldflags =' -fstack-protector -L/usr/local/lib'   libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib   libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc   perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc   libc=\, so=so\, useshrplib=true\, libperl=libperl.so   gnulibc_version='2.15'   Dynamic Linking​:   dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags='-Wl\,-E -Wl\,-rpath\,/home/leon/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux-thread-multi/CORE'   cccdlflags='-fPIC'\, lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches​:


@​INC for perl 5.16.1​:   /home/leon/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1/x86_64-linux-thread-multi   /home/leon/perl5/perlbrew/perls/perl-5.16.1/lib/site_perl/5.16.1   /home/leon/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/x86_64-linux-thread-multi   /home/leon/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1   .


Environment for perl 5.16.1​:   HOME=/home/leon   LANG=en_US.UTF-8   LANGUAGE=en_US​:en   LC_ADDRESS=en_US.UTF-8   LC_IDENTIFICATION=en_US.UTF-8   LC_MEASUREMENT=en_US.UTF-8   LC_MONETARY=en_US.UTF-8   LC_NAME=en_US.UTF-8   LC_NUMERIC=en_US.UTF-8   LC_PAPER=en_US.UTF-8   LC_TELEPHONE=en_US.UTF-8   LC_TIME=en_US.UTF-8   LD_LIBRARY_PATH (unset)   LOGDIR (unset)   PATH=/home/leon/perl5/perlbrew/bin​:/home/leon/perl5/perlbrew/perls/perl-5.16.1/bin​:/home/leon/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games​:/usr/local/games   PERLBREW_HOME=/home/leon/.perlbrew   PERLBREW_PATH=/home/leon/perl5/perlbrew/bin​:/home/leon/perl5/perlbrew/perls/perl-5.16.1/bin   PERLBREW_PERL=perl-5.16.1   PERLBREW_ROOT=/home/leon/perl5/perlbrew   PERLBREW_VERSION=0.25   PERL_BADLANG (unset)   SHELL=/bin/bash

p5pRT commented 11 years ago

From @jkeenan

On Thu Apr 25 13​:28​:15 2013\, LeonT wrote​:

This is a bug report for perl from fawaka@​gmail.com\, generated with the help of perlbug 1.39 running under perl 5.16.1.

-----------------------------------------------------------------

I recently took the liberty to convert our asian readme files from euc-* to utf-8\, but I didn't update their contents. I can't understand them\, but they still seem to advocate �use encoding�. Someone who actually groks the languages should probably update their content.

Are these all the files you were referring to?

README.cn README.jp README.ko

p5pRT commented 11 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 11 years ago

From @khwilliamson

On 05/08/2013 07​:24 PM\, James E Keenan via RT wrote​:

On Thu Apr 25 13​:28​:15 2013\, LeonT wrote​:

This is a bug report for perl from fawaka@​gmail.com\, generated with the help of perlbug 1.39 running under perl 5.16.1.

-----------------------------------------------------------------

I recently took the liberty to convert our asian readme files from euc-* to utf-8\, but I didn't update their contents. I can't understand them\, but they still seem to advocate �use encoding�. Someone who actually groks the languages should probably update their content.

Are these all the files you were referring to?

README.cn README.jp README.ko

--- via perlbug​: queue​: perl5 status​: new https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117765

I don't know if there are more\, but these 3 are definitely ones he modified. (I used git blame on the files to check.)

p5pRT commented 11 years ago

From @khwilliamson

On 05/08/2013 08​:20 PM\, Karl Williamson wrote​:

On 05/08/2013 07​:24 PM\, James E Keenan via RT wrote​:

On Thu Apr 25 13​:28​:15 2013\, LeonT wrote​:

This is a bug report for perl from fawaka@​gmail.com\, generated with the help of perlbug 1.39 running under perl 5.16.1.

-----------------------------------------------------------------

I recently took the liberty to convert our asian readme files from euc-* to utf-8\, but I didn't update their contents. I can't understand them\, but they still seem to advocate �use encoding�. Someone who actually groks the languages should probably update their content.

Are these all the files you were referring to?

README.cn README.jp README.ko

--- via perlbug​: queue​: perl5 status​: new https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117765

I don't know if there are more\, but these 3 are definitely ones he modified. (I used git blame on the files to check.)

I ran perldoc -o html README.jp > jp.html

then read that file with my browser\, and ran Google translate on it\, and got the following​:

NAME

perljp - Japanese Perl Guide Description

Welcome to the world of Perl!

From Perl 5.8.0\, Unicode support is greatly enhanced support for character code of non-Latin characters have been added\, including (Chinese\, Japanese\, Korean) CJK the result. Unicode is a standard that aims to treat the character code of a single character in the world\, (Greek\, Cyrillic\, Arabic\, Hebrew\, Deevana gari character character in between west\, or even from the east\, etc.)\, and\, so far has already includes Macintosh) and (PC character the OS vendor has established its own.

Perl itself works with Unicode. Regular expression or string literal a Perl script is assumed Unicode. And for input and output\, module corresponding to the different character code\, which had been used\, "Encode" has been standard equipment\, it has to make it easy interconversion of these two character codes to Unicode and You.

Character code Encode supports at this time are as follows.

  7bit-jis AdobeStandardEncoding AdobeSymbol AdobeZdingbat   ascii big5 big5-hkscs cp1006   cp1026 cp1047 cp1250 cp1251   cp1252 cp1253 cp1254 cp1255   cp1256 cp1257 cp1258 cp37   cp424 cp437 cp500 cp737   cp775 cp850 cp852 cp855   cp856 cp857 cp860 cp861   cp862 cp863 cp864 cp865   cp866 cp869 cp874 cp875   cp932 cp936 cp949 cp950   dingbats euc-cn euc-jp euc-kr   gb12345-raw gb2312-raw gsm0338 hp-roman8   hz iso-2022-jp iso-2022-jp-1 iso-8859-1   iso-8859-10 iso-8859-11 iso-8859-13 iso-8859-14   iso-8859-15 iso-8859-16 iso-8859-2 iso-8859-3   iso-8859-4 iso-8859-5 iso-8859-6 iso-8859-7   iso-8859-8 iso-8859-9 iso-ir-165 jis0201-raw   jis0208-raw jis0212-raw johab koi8-f   koi8-r koi8-u ksc5601-raw MacArabic   MacCentralEurRoman MacChineseSimp MacChineseTrad MacCroatian   MacCyrillic MacDingbats MacFarsi MacGreek   MacHebrew MacIcelandic MacJapanese MacKorean   MacRoman MacRomanian MacRumanian MacSami   MacSymbol MacThai MacTurkish MacUkrainian   nextstep posix-bc shiftjis symbol   UCS-2BE UCS-2LE UTF-16 UTF-16BE   UTF-16LE UTF-32 UTF-32BE UTF-32LE   utf8 viscii

(All 114 types)

For example\, to convert files to UTF-8 character encoding FOO\, do the following.

  perl-Mencoding = FOO\, STDOUT\, utf8-pe1 \<file.FOO> file.utf8

In addition\, the Perl\, character code conversion utility written in Perl is all\, piconv Because the attached\, I can be as follows.

  piconv-f FOO-t utf8 \<file.FOO> file.utf8   piconv-f utf8-t FOO \<file.utf8> file.FOO

About (jcode.pl | Jcode.pm | JPerl)

I was able to handle only literal of 5.8 previous script is in the EUC-JP. In addition\, Jcode.pm is (http​://openlab.ring.gr.jp/Jcode/)\, jcode.pl exists as each utility perl4 for the CGI to handle the Japanese language as a module to handle the input and output It seems that you know also whether not a few that is often used. However\, you can handle both of regular expressions in Japanese was not possible.

The Perl 5.005 earlier\, localized versions that specializes in Japanese\, Jperl there were the (http​://homepage2.nifty.com/kipp/perl/jperl/index.html). In addition\, Perl of Mac OS 9.x/Classic for Japanese version of MacPerl also were present as MacJPerl. It was also possible to treat regular expressions in Japanese Shift_JIS that also treat the addition to EUC-JP as the character code\, and also possible in (http​://habilis.net/macjperl/). These.

In Perl5.8\, you can on these features can be realized only by Perl itself all\, all\, dealing at the same time And the character code above 114 not only Japanese. In addition\, we can now also be easily used to get a new module of the character code for the like CPAN.

  Input and output

  The following example will output Izure be converted to EUC-JP input Shift_JIS.

  # Jcode.pl   require "jcode.pl";   while (\<>) {   jcode :​: convert (* _\, 'euc'\, 'sjis');   print;   }   # Jcode.pm   use Jcode;   while (\<>) {   print Jcode-> new ($ _\, 'sjis') -> euc;   }   # Perl 5.8   use Encode;   while (\<>) {   from_to ($ _\, 'shiftjis'\, 'euc-jp');   print;   }   # 5.8 Perl - by using the encoding   use encoding 'euc-jp'\, STDIN => 'shiftjis';   while (\<>) {   print;   }

  Jperl compatible script

  It seems you only need to change the so-called "shebang"\, that it is available without changing most of the script of Jperl for.

  #! / Path / to / jperl   ↓   #! / Path / to / perl-Mencoding = euc-jp

  Please refer to the perldoc encoding for more information.

Learn More

Tomes comes with a Perl\, (unfortunately\, although there is little in English)\, such as the use of Encode module and Unicode support\, new features and Perl has been covered over. It is possible to view some of them with the following command.

  Unicode support in general perldoc perlunicode # Perl   respect perldoc Encode # Encode module   respect perldoc Encode :​: JP # out Japanese character code

The URL about Perl in general

http​://www.perl.com/

  Perl Home Page (O'Reilly and Associates) http​://www.cpan.org/

  CPAN (Comprehensive Perl Archive Network) http​://lists.perl.org/

  Perl mailing list collection

URL to help you learn the Perl

http​://www.oreilly.com.tw/

  Perl Books of O'Reilly's (Traditional Chinese) http​://www.oreilly.com.cn/

  Perl Books of O'Reilly's (Simplified Chinese) http​://www.oreilly.co.jp/catalog/

  Perl Books of O'Reilly (Japanese)

Perl user group

http​://www.pm.org/groups/asia.html

URL of the Unicode-related

http​://www.unicode.org/

  (Select organization of the Unicode standard) Unicode Consortium http​://www.cl.cam.ac.uk/% 7Emgk25/unicode.html

  UTF-8 and Unicode FAQ for Unix / Linux http​://wiki.kldp.org/Translations/html/UTF8-Unicode-KLDP/UTF8-Unicode-KLDP.html

  UTF-8 and Unicode FAQ for Unix / Linux (Korean translation)

AUTHORS

Jarkko Hietaniemi \jhi@&#8203;iki\.fi Dan Kogai (small shepherd bullet) \dankogai@&#8203;dan\.co\.jp

p5pRT commented 11 years ago

From @Leont

On Thu\, May 9\, 2013 at 3​:24 AM\, James E Keenan via RT \perlbug\-followup@&#8203;perl\.org wrote​:

Are these all the files you were referring to?

README.cn README.jp README.ko

Yeah\, and also README.tw.

Leon

p5pRT commented 11 years ago

From @gugod

On Thu May 09 01​:44​:48 2013\, LeonT wrote​:

On Thu\, May 9\, 2013 at 3​:24 AM\, James E Keenan via RT \perlbug\-followup@&#8203;perl\.org wrote​:

Are these all the files you were referring to?

README.cn README.jp README.ko

Yeah\, and also README.tw.

Leon

I removed all references of encoding in READEM.tw

The first one was rewritten with equivalent "Encode" code to demonstrate the same functionality. The second part was rewritten to demonstrate how perl can do character-based operations on utf8 source code.

The patch is attached.

p5pRT commented 11 years ago

From @gugod

0001-Remove-references-of-encoding-module-in-README.tw.patch ```diff From bab866ce9e16fc2dc46728115f0537c6b601fa0c Mon Sep 17 00:00:00 2001 From: Kang-min Liu Date: Sat, 11 May 2013 20:00:53 +0200 Subject: [PATCH] Remove references of "encoding" module in README.tw --- README.tw | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/README.tw b/README.tw index 2a4dcf5..4b41f3d 100644 --- a/README.tw +++ b/README.tw @@ -31,26 +31,21 @@ Encode ��������������������������������������������������� ('big5' ������ 'big5- ������������, ��� Big5 ��������������������� Unicode, ������������������������: - perl -Mencoding=big5,STDOUT,utf8 -pe1 < file.big5 > file.utf8 + perl -MEncode=decode,encode -pe '$_= encode( utf8 => decode( big5 => $_ ) )' < file.big5 > file.utf8 Perl ������������ "piconv", ��������������� Perl ���������������������������������, ������������: piconv -f big5 -t utf8 < file.big5 > file.utf8 piconv -f utf8 -t big5 < file.utf8 > file.big5 -������, ������ encoding ������, ���������������������������������������������������, ������������: +������������������������������ utf8 ��������������������������� utf8 ��������������������������������������������� +��������������������������������������������������������������������� #!/usr/bin/env perl - # ������ big5 ������������; ��������������������������������������� big5 ������ - use encoding 'big5', STDIN => 'big5', STDOUT => 'big5'; - print length("������"); # 2 (���������������������) - print length('������'); # 4 (������������������������) - print index("������������", "������"); # -1 (���������������������) - print index('������������', '������'); # 1 (���������������������������) + use utf8; + print length("������"); # 2 (������ 6) + print index("������������", "������"); # 2 (��� 0 ��������� 2 ���������) -������������������������, "���" ������������������������ "���" ������������������������������ Big5 -������ "���"; "���" ��������������������������� "���" ������������������������������ "���". -������������������ Big5 ���������������������������������. =head2 ��������������������� @@ -155,7 +150,7 @@ L =head1 SEE ALSO -L, L, L, L, L +L, L, L, L =head1 AUTHORS -- 1.8.2.1 ```
p5pRT commented 11 years ago

From @rjbs

On Sat May 11 11​:11​:32 2013\, gugod@​gugod.org wrote​:

The patch is attached.

Thanks\, applied as e4ea314.

I also subsequently applied 55b2202 and d7b1992. Welcome to the perl 5 AUTHORS file\, gugod!

-- rjbs

p5pRT commented 11 years ago

From @jkeenan

On Sun Jun 09 08​:40​:43 2013\, rjbs wrote​:

On Sat May 11 11​:11​:32 2013\, gugod@​gugod.org wrote​:

The patch is attached.

Thanks\, applied as e4ea314.

I also subsequently applied 55b2202 and d7b1992. Welcome to the perl 5 AUTHORS file\, gugod!

Do we have any criteria for determining when this ticket becomes closable?

Thank you very much. Jim Keenan

p5pRT commented 11 years ago

From @rjbs

* James E Keenan via RT \perlbug\-followup@&#8203;perl\.org [2013-06-13T22​:11​:53]

On Sun Jun 09 08​:40​:43 2013\, rjbs wrote​:

On Sat May 11 11​:11​:32 2013\, gugod@​gugod.org wrote​:

The patch is attached.

Thanks\, applied as e4ea314.

I also subsequently applied 55b2202 and d7b1992. Welcome to the perl 5 AUTHORS file\, gugod!

Do we have any criteria for determining when this ticket becomes closable?

Yes. I have put out a call for review by native readers. Once I get that review for each of the relevant files and take action accordingly\, I will close this ticket.

I haven't set a deadline yet\, but I may keep this open through September so I can call for review in person at YAPC​::Asia if needed.

-- rjbs

p5pRT commented 11 years ago

From keedi@cpan.org

On Thu Jun 13 19​:17​:04 2013\, perl.p5p@​rjbs.manxome.org wrote​:

I haven't set a deadline yet\, but I may keep this open through September so I can call for review in person at YAPC​::Asia if needed.

The patch for korean version of README is attached.

- Removed old-fashioned encoding related example - Translated original README into README.ko - Updated several local Perl links for Korean

p5pRT commented 11 years ago

From keedi@cpan.org

0001-Update-brand-new-README.ko.patch ```diff From 89eb5926d791f560b0f21d2e6bb6bd7bbcb7e77b Mon Sep 17 00:00:00 2001 From: Keedi Kim Date: Fri, 5 Jul 2013 02:11:12 +0900 Subject: [PATCH] Update brand-new README.ko MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.8.3.2" This is a multi-part message in MIME format. --------------1.8.3.2 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- README.ko | 339 ++++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 239 insertions(+), 100 deletions(-) --------------1.8.3.2 Content-Type: text/x-patch; name="0001-Update-brand-new-README.ko.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0001-Update-brand-new-README.ko.patch" diff --git a/README.ko b/README.ko index 2632135..a349e05 100644 --- a/README.ko +++ b/README.ko @@ -1,201 +1,340 @@ =encoding utf8 -이 문서를 perldoc을 써서 보지 않고 직접 보는 경우에는 각 부분의 -역할을 표시하기 위해 쓰인 =head, =item, 'L' 등은 무시하십시오. -이 문서는 따로 perldoc을 쓰지 않고 보더라도 읽는데 별 지장이 -없는 POD 형식으로 짜여 있습니다. 더 자세한 것은 perlpod -매뉴얼을 참고하십시오. +이 파일을 내용 그대로 읽고 있다면 우스꽝스러운 문자는 무시해주세요. +이 문서는 POD로 읽을 수 있도록 POD 형식(F 문서를 +확인하세요)으로 작성되어 있습니다. + =head1 NAME -perlko - Perl과 한국어 인코딩 +perlko - 한국어 Perl 안내서 + =head1 DESCRIPTION -Perl의 세계에 오신 것을 환영합니다 ! +Perl의 세계에 오신 것을 환영합니다! + +Perl은 가끔 B<'Practical Extraction and Report Language'>라고 하기도 합니다만 +다른 널리 알려진 것들 중에서 B<'Pathologically Eclectic Rubbish Lister'>라고 +하기도 합니다. 사실 이것은 끼워 맞춘 것이며 Perl이 이것들의 첫 글자를 +가져와서 이름을 붙인 것은 아닙니다. Perl의 창시자 Larry가 첫 번째 이름을 +먼저 생각했고 널리 알려진 것을 나중에 지었기 때문입니다. 그렇기 때문에 +B<'Perl'>은 모두 대문자가 아닙니다. 널리 알려진 어떤 것을 가지고 논쟁하는 +것은 의미가 없습니다. Larry는 두 개 다 지지합니다. + +가끔 p가 소문자로 작성된 B<'perl'>을 볼 것입니다. P가 대문자로 되어 있는 +B<'Perl'>은 언어를 참조할 때 쓰이며 B<'perl'>처럼 p가 소문자인 경우는 여러분의 +프로그램을 컴파일하고 돌릴 때 사용되는 해석기를 지칭할 때 사용됩니다. + + +=head1 Perl에 관하여 + +Perl은 본래 문자열 생성을 위해 만들졌지만 지금은 시스템 관리와 웹 개발, +네트워크 프로그래밍, GUI 개발 등을 포함한 여러 분야에서 널리 사용되는 +범용 프로그래밍 언어입니다. + +이 언어는 아름다움(아주 작고, 우아하고, 아주 적고)보다 +실용적(사용하기 쉽고, 효율적이며, 가능한 최대한)인 것을 지향하고 있습니다. +사용하기 쉽고, 절차적 프로그래밍과 객체 지향 프로그래밍을 모두 지원하고, +강력한 문자열 처리 기능을 내장하고, 세상에서 가장 인상적인 제 3자의 모듈 +모음처를 가지고 있다는 것은 Perl의 가장 중요한 특징입니다. + +Perl의 언어적 특징은 F 문서에서 소개합니다. + +이번 릴리스에서 가장 중요한 변화는 F에서 논의합니다. + +또한 다양한 출판사가 출판한 많은 Perl 책은 다양한 주제를 다루고 있습니다. +자세한 정보는 F 문서를 확인하세요. + + +=head1 설치 + +여러분이 비교적 현대의 운영체제를 사용하고 있고 현재 버전의 Perl을 +지역적으로 설치하고 싶다면 다음 명령을 실행하세요. + + ./Configure -des -Dprefix=$HOME/localperl + make test + make install + +앞의 명령은 여러분의 플랫폼에 맞게 환경을 설정하고 컴파일을 수행한 후, +회기 테스트를 수행한뒤, 홈 디렉터리 하부의 F 디렉터리에 perl을 +설치합니다. + +여러분이 어떠한 문제든 겪게 되거나 사용자 정의 버전 Perl을 설치할 필요가 있다면 +현재 배포판에 들어있는 F 파일 안의 자세한 설명을 읽어야 합니다. +추가적으로 일반적이지 않은 다양한 플랫폼에서 Perl을 빌드하고 사용하는 +방법에 대한 도움말과 귀띔이 적혀있는 많은 수의 F 파일이 있습니다. +일단 Perl을 설치하고 나면 C 도구를 이용해 풍부한 문서를 사용할 +수 있습니다. 시작하기 위해서 다음 명령을 실행하세요. -Perl은 5.8.0판부터 유니코드/ISO 10646에 대한 광범위한 지원을 합니다. + perldoc perl + + +=head1 실행에 어려움을 겪는다면 + +Perl은 뜨개질에서 부터 로켓 과학까지 모든 분야에서 사용할 수 있는 크고 +복잡한 시스템입니다. 여러분이 어려움에 부딪혔을때 그 문제는 이미 다른 +사람이 해결했을 가능성이 높습니다. 문서를 모두 확인했는데도 버그가 +확실하다면 C 도구를 이용해서 저희에게 버그를 보고해주세요. +C에 대한 더 자세한 정보는 C 또는 C를 +명령줄에서 실행해서 확인할 수 있습니다. + +Perl을 사용 가능하게 만들었다 하더라도 Perl은 계속해서 진화하기 때문에 +여러분이 맞닥뜨린 버그를 수정했거나 여러분이 유용하다고 생각할법한 +새로운 기능이 추가된 좀 더 최신 버전이 있을 수 있습니다. + +여러분은 항상 최신 버전의 perl을 CPAN (Comprehensive Perl Archive Network) +사이트 L 에서 찾을 수 있습니다. + +perl 소스에 간단한 패치를 등록하고 싶다면 F 문서의 +B<"SUPER QUICK PATCH GUIDE">를 살펴보세요. + +그냥 개인적으로 참고하세요. +제가 이것처럼 멋진 물건을 만든다는 것을 여러분이 알기를 바랍니다. +그것은 제 이야기의 B<"저자(Author)">를 기쁘게하기 때문입니다. +이것이 여러분을 귀찮게 한다면 여러분의 B<"저작(Authorship)">에 +대한 생각을 정정해야 할 수도 있습니다. 하지만 어쨌거나 여러분은 +Perl을 사용하는데는 문제가 없답니다. :-) + +- B<"저자">로부터. + + +=head1 인코딩 + +Perl은 5.8.0판부터 유니코드/ISO 10646에 대해 광범위하게 지원합니다. 유니코드 지원의 일환으로 한중일을 비롯한 세계 각국에서 유니코드 이전에 쓰고 있었고 지금도 널리 쓰이고 있는 수많은 인코딩을 -지원합니다. 유니코드는 전 세계에서 쓰이는 모든 언어를 위한 표기 체계 - -유럽의 라틴 알파벳, 키릴 알파벳, 그리스 알파벳, 인도와 동남 아시아의 +지원합니다. 유니코드는 전 세계에서 쓰이는 모든 언어를 위한 +표기 체계(유럽의 라틴 알파벳, 키릴 알파벳, 그리스 알파벳, 인도와 동남 아시아의 브라미 계열 스크립트, 아랍 문자, 히브리 문자, 한중일의 한자, 한국어의 한글, -일본어의 가나, 북미 인디안의 표기 체계 등-를 수용하는 것을 목표로 하고 +일본어의 가나, 북미 인디안의 표기 체계 등)를 수용하는 것을 목표로 하고 있기 때문에 기존에 쓰이던 각 언어 및 국가 그리고 운영 체계에 고유한 문자 집합과 인코딩에 쓸 수 있는 모든 글자는 물론이고 기존 문자 집합에서 지원하고 있지 않던 아주 많은 글자를 포함하고 있습니다. - -Perl은 내부적으로 유니코드를 문자 표현을 위해 사용합니다. 보다 구체적으로 -말하면 Perl 스크립트 안에서 UTF-8 문자열을 쓸 수 있고, +Perl은 내부적으로 유니코드를 문자 표현을 위해 사용합니다. +보다 구체적으로 말하면 Perl 스크립트 안에서 UTF-8 문자열을 쓸 수 있고, 각종 함수와 연산자(예를 들어, 정규식, index, substr)가 바이트 단위 -대신 유니코드 글자 단위로 동작합니다. (더 자세한 것은 -perlunicode 매뉴얼을 참고하십시오.) 유니코드가 널리 보급되기 전에 -널리 쓰이고 있었고, 여전히 널리 쓰이고 있는 각국/각 언어별 인코딩으로 -입출력을 하고 이들 인코딩으로 된 데이터와 문서를 다루는 것을 돕기 위해 -'Encode'가 쓰였습니다. 무엇보다 'Encode'를 써서 수많은 인코딩 사이의 -변환을 쉽게 할 수 있습니다. +대신 유니코드 글자 단위로 동작합니다. +더 자세한 것은 F 문서를 참고하세요. +유니코드가 널리 보급되기 전에 널리 쓰이고 있었고, 여전히 널리 쓰이고 있는 +각국/각 언어별 인코딩으로 입출력을 하고 이들 인코딩으로 된 데이터와 문서를 +다루는 것을 돕기 위해 L 모듈이 쓰이고 있습니다. +무엇보다 L 모듈을 사용하면 수많은 인코딩 사이의 변환을 쉽게 할 수 있습니다. + -'Encode'는 다음과 같은 한국어 인코딩을 지원합니다. +=head2 Encode 모듈 + +=head3 지원 인코딩 + +L 모듈은 다음과 같은 한국어 인코딩을 지원합니다. =over 4 -=item * euc-kr +=item * C -US-ASCII와 KS X 1001을 같이 쓰는 멀티바이트 인코딩 (흔히 완성형이라고 -불림.) KS X 2901과 RFC 1557 참고. +US-ASCII와 KS X 1001을 같이 쓰는 멀티바이트 인코딩으로 흔히 +완성형이라고 불림. KS X 2901과 RFC 1557 참고. -=item * cp949 +=item * C -MS-Windows 9x/ME에서 쓰이는 확장 완성형. euc-kr에 8,822자의 -한글 음절을 더한 것임. alias는 uhc, windows-949, x-windows-949, +MS-Windows 9x/ME에서 쓰이는 확장 완성형. euc-kr에 8,822자의 +한글 음절을 더한 것임. alias는 uhc, windows-949, x-windows-949, ks_c_5601-1987. 맨 마지막 이름은 적절하지 않은 이름이지만, Microsoft 제품에서 CP949의 의미로 쓰이고 있음. -=item * johab +=item * C -KS X 1001:1998 부록 3에서 규정한 조합형. 문자 레퍼토리는 cp949와 -마찬가지로 US-ASCII와 KS X 1001에 8,822자의 한글 음절을 더한 것임. -인코딩 방식은 전혀 다름. +KS X 1001:1998 부록 3에서 규정한 조합형. 문자 레퍼토리는 cp949와 마찬가지로 +US-ASCII와 KS X 1001에 8,822자의 한글 음절을 더한 것으로 인코딩 방식은 전혀 다름. -=item * iso-2022-kr +=item * C RFC 1557에서 규정한 한국어 인터넷 메일 교환용 인코딩으로 US-ASCII와 KS X 1001을 레퍼토리로 하는 점에서 euc-kr과 같지만 인코딩 방식이 다름. 1997-8년 경까지 쓰였으나 더 이상 메일 교환에 쓰이지 않음. -=item * ksc5601-raw +=item * C -KS X 1001(KS C 5601)을 GL(즉, MSB를 0으로 한 경우) 에 놓았을 때의 -인코딩. US-ASCII와 결합하지 않고 단독으로 쓰이는 일은 X11 등에서 글꼴 -인코딩 (ksc5601.1987-0. '0'은 GL을 의미함.)으로 쓰이는 것을 제외하고는 -거의 없음. KS C 5601은 1997년 KS X 1001로 이름을 바꾸었음. 1998년에는 두 -글자 (유로화 부호와 등록 상표 부호)가 더해졌음. +KS X 1001(KS C 5601)을 GL(즉, MSB를 0으로 한 경우)에 놓았을 때의 인코딩. +US-ASCII와 결합하지 않고 단독으로 쓰이는 일은 X11 등에서 글꼴 +인코딩(ksc5601.1987-0. '0'은 GL을 의미함)으로 쓰이는 것을 제외하고는 +거의 없음. KS C 5601은 1997년 KS X 1001로 이름을 바꾸었음. 1998년에는 두 +글자(유로화 부호와 등록 상표 부호)가 더해졌음. =back -몇 가지 사용 예제를 아래에 보입니다. +=head3 변환 예제 -예를 들어, euc-kr 인코딩으로 된 파일을 UTF-8로 변환하려면 다음과 -같이 하면 됩니다. +예를 들어, euc-kr 인코딩으로 된 파일을 UTF-8로 변환하려면 +명령줄에서 다음처럼 실행합니다. + perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euc-kr > file.utf8 - perl -Mencoding=euc-kr,STDOUT,utf8 -pe1 < file.euckr > file.utf8 +반대로 변환할 경우 다음처럼 실행합니다. -역변환은 다음과 같이 할 수 있습니다. + perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euc-kr - perl -Mencoding=utf8,STDOUT,euc-kr -pe1 < file.utf8 > file.euckr +이런 변환을 좀더 편리하게 할 수 있도록 도와주는 F가 Perl에 +기본으로 들어있습니다. 이 유틸리티는 L 모듈을 이용한 순수 Perl +유틸리티로 이름에서 알 수 있듯이 Unix의 C를 모델로 한 것입니다. +사용법은 다음과 같습니다. -이런 변환을 좀더 편리하게 할 수 있도록 Encode 모듈을 써서 -순수하게 Perl로만 쓰인 piconv가 Perl에 들어 있습니다. -그 이름에서 알 수 있듯이 piconv는 Unix에 있는 iconv를 -모델로 한 것입니다. 그 사용법은 아래와 같습니다. + piconv -f euc-kr -t utf8 < file.euc-kr > file.utf8 + piconv -f utf8 -t euc-kr < file.utf8 > file.euc-kr - piconv -f euc-kr -t utf8 < file.euckr > file.utf8 - piconv -f utf8 -t euc-kr < file.utf8 > file.euckr +=head3 모범 사례 -또, 'PerlIO::encoding' 모듈을 써서 한국어 인코딩을 쓰면서 글자 단위 -(바이트 단위가 아니라) 처리를 쉽게 할 수 있습니다. +Perl은 기본적으로 내부에서 UTF-8을 사용하며 Encode 모듈을 통해 +다양한 인코딩을 지원하지만 항상 다음 규칙을 지킴으로써 인코딩과 +관련한 다양하게 발생할 수 있는 문제의 가능성을 줄이는 것을 추천합니다. - #!/path/to/perl +=over 4 - use encoding 'euc-kr', STDIN => 'euc-kr', - STDOUT-> 'euc-kr', STDERR=>'euc-kr'; +=item * 소스 코드는 항상 UTF-8 인코딩으로 저장 - print length("가나"); # 2 (큰 따옴표는 글자 단위 처리를 지시) - print length('가나'); # 4 (작은 따옴표는 바이트 단위 처리를 지시) - print index("한강, 대동강", "염"); # -1 ('염'이 없음) - print index('한강, 대동강', '염'); # 7 (8번째와 9번째 바이트가 '염'의 - 코드값과 일치함.) +=item * 소스 코드 상단에 C 프라그마 사용 +=item * 소스 코드, 터미널, 운영체제, 데이터 인코딩을 분리해서 이해 -=head2 더 자세히 알고 싶으면... +=item * 입출력 파일 핸들에 명시적인 인코딩을 사용 -Perl을 설치하면 대단히 자세한 문서가 같이 따라 오며, 이 문서를 통해 -Perl 전반 뿐 아니라 유니코드 지원, Encode의 사용법 등에 많은 것을 -배울 수 있습니다. 아직 이 문서는 현재 모두 영어로 쓰여 있습니다. +=item * 중복(double) 인코딩을 주의 +=back -=head2 Perl 관련 자료 -위에서 언급한 문서 외에도 다음과 같은 자료가 있습니다. 이 목록은 결코 -완전한 것이 아니고 일부 대표적인 것만 모은 것입니다. +=head3 유니코드 및 한국어 인코딩 관련 자료 =over 4 -=item L +=item * L - O'Reilly의 Perl 웹 페이지 +=item * L -=item L +=item * L - Comprehensive Perl Archive Network +=item * L -=item L +=item * L - Perl 메일링 리스트. 많은 리스트 가운데 - perl-unicode에서 'Encode'에 대해 논의함. +=item * L + +유니코드 컨소시엄 + +=item * L + +기본적으로 Unicode와 같은 ISO 표준인 ISO/IEC 10646 UCS(Universal +Character Set)을 만드는 ISO/IEC JTC1/SC2/WG2의 웹 페이지 + +=item * L + +유닉스/리눅스 사용자를 위한 UTF-8 및 유니코드 관련 FAQ + +=item * L + +유닉스/리눅스 사용자를 위한 UTF-8 및 유니코드 관련 FAQ의 한국어 번역 =back -=head2 Perl을 더 깊게 공부하는데 도움을 줄 수 있는 한국어 관련 사이트 + +=head1 Perl 관련 자료 + +다음은 공식적인 Perl 관련 자료중 일부입니다. =over 4 -=item L +=item * L + +Perl 공식 홈페이지 + +=item * L + +O'Reilly의 Perl 웹 페이지 + +=item * L + +CPAN - Comprehensive Perl Archive Network, 통합적 Perl 파일 보관 네트워크 + +=item * L + +메타 CPAN - Perl 한국 사용자 모임 +=item * L -=item L +Perl 메일링 리스트 - 한국어 Perl 뉴스 그룹 +=item * L -=item L +Perl 메타 블로그 - O'Reilly에서 나온 한국어 Perl 서적 목록 +=item * L -=item L +Perl 수도승들을 위한 수도원 - Perl 기초 강좌 및 소스, 최근 동향, 관련 해외 사이트 링크 +=item * L -=item L +아시아 지역 Perl 몽거스 모임 - Perl에 관련된 CGI, DB, 연동 등에 대한 정보 및 뉴스 제공 +=item * L -=back +Perl 크리스마스 달력 -=head2 유니코드 및 한국어 인코딩 관련 자료 +=back + + +다음은 Perl을 더 깊게 공부하는데 도움을 줄 수 있는 한국어 관련 사이트입니다. =over 4 -=item L +=item * L - 유니코드 컨소시엄. +한국 Perl 커뮤니티 공식 포털 -=item L +=item * L -기본적으로 Unicode와 같은 ISO 표준인 ISO/IEC 10646 UCS(Universal -Character Set)을 만드는 ISO/IEC JTC1/SC2/WG2의 웹 페이지. +Perl 문서 한글화 프로젝트 + +=item * L + +네이버 Perl 카페 + +=item * L + +한국 Perl 사용자 모임 + +=item * L -=item L +Seoul.pm Perl 크리스마스 달력 (2010 ~ 2012) - 유닉스/리눅스에서 유니코드와 UTF-8 사용에 대한 문답집(FAQ) +=item * L -=item L +GYPARK(Geunyoung Park)의 Perl 관련 한글 문서 저장소 - 유닉스/리눅스에서 유니코드와 UTF-8 사용에 대한 문답집(FAQ)의 한국어 번역 +=item * L + +Seoul.pm - 서울 Perl 몽거스 =back -=head1 SEE ALSO -L, L, L, L, L +=head1 라이센스 + +F 파일의 B<'LICENSING'> 항목을 참고하세요. =head1 AUTHORS -Jarkko Hietaniemi Ejhi@iki.fiE -신정식 Ejshin@mailaps.orgE +=over + +=item * Jarkko Hietaniemi Ejhi@iki.fiE + +=item * 신정식 Ejshin@mailaps.orgE + +=item * 김도형 Ekeedi@cpan.orgE + +=back + =cut --------------1.8.3.2-- ```
p5pRT commented 11 years ago

From @cpansprout

On Thu Jul 04 10​:25​:33 2013\, keedi wrote​:

On Thu Jun 13 19​:17​:04 2013\, perl.p5p@​rjbs.manxome.org wrote​:

I haven't set a deadline yet\, but I may keep this open through September so I can call for review in person at YAPC​::Asia if needed.

The patch for korean version of README is attached.

- Removed old-fashioned encoding related example - Translated original README into README.ko - Updated several local Perl links for Korean

Thank you. Applied as 277d344a7. I added you to the AUTHORS file in e9da8ca7b8.

--

Father Chrysostomos

p5pRT commented 10 years ago

From @rjbs

Father Chrysostomos notes​:

At the very least\, we should rewrite the command lines that make use of encoding.pm. E.g.\, README.ko has this​:

perl -Mencoding=euc-kr\,STDOUT\,utf8 -pe1 \< file.euc-kr > file.utf8

-- rjbs

p5pRT commented 10 years ago

From @rjbs

I'd like to find volunteers for README review of the outstanding languages\, but I don't think this ticket is the right way forward.

-- rjbs

p5pRT commented 10 years ago

@rjbs - Status changed from 'open' to 'resolved'