b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / share / perl5 / pod /
Filename/usr/share/perl5/pod/perlcn.pod
Size4.8 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified22-Mar-2017 16:32
Last accessed22-Mar-2017 16:32
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
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.

The following documentation is written in EUC-CN encoding.

��你������������份�件, 请忽��中���注记�符.
�份�件�以 POD (���件格�) ��; ��格��为��让人���读,
���设计�. ��此格����步信�, 请�� perlpod 线��件.

=encoding euc-cn

=head1 NAME

perlcn - ��中� Perl ��

=head1 DESCRIPTION

欢��� Perl �天�!

� 5.8.0 ���, Perl ������ Unicode (���) ��,
��带���许���语系以������; CJK (中��) 便��中���份.
Unicode �������, ��涵��������符: 西���, ����,
以�两����� (���, ����, ��伯�, �伯��, �度�,
����, ��). ��容纳�����系��平� (� PC �麦��).

Perl �身以 Unicode ����. �表示 Perl ����符串���� Unicode
表示; Perl �����符 (��正�表示��对) ��对 Unicode ����.
�������, 为���以 Unicode ������������, Perl
��� Encode �个模�, �以让你轻��读�����������.

Encode 延伸模�������中������ ('gb2312' 表示 'euc-cn'):

euc-cn Unix 延伸�符�, �就��称����
gb2312-raw ����� (���) GB2312 �符表
gb12345 �����中����中���
iso-ir-165 GB2312 + GB6345 + GB8565 + ���符
cp936 ��页 936, ��以� 'GBK' (�����) ��
hz 7 ����� GB2312 ��

举��说, � EUC-CN ���档�转� Unicode, �������令:

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

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 模�, 你�以轻���以�符为������, ���示:

#!/usr/bin/env perl
# �� euc-cn �串解�; ���������误�设为 euc-cn ��
use encoding 'euc-cn', STDIN => 'euc-cn', STDOUT => 'euc-cn';
print length("�驼"); # 2 (���表示�符)
print length('�驼'); # 4 (���表示��)
print index("���诲", "��"); # -1 (���此��符串)
print index('���诲', '��'); # 1 (�第�个����)

��������, "�" �第�个��� "�" �第�个����� EUC-CN
�� "�"; "�" �第�个���� "�" �第�个����� "�".
�解��以� EUC-CN ��对���常����.

=head2 ���中���

�������中���, �以� CPAN (L<http://www.cpan.org/>) �载
Encode::HanExtra 模�. �����������:

gb18030 �������, ����中�

��, Encode::HanConvert 模�������转���两���:

big5-simp Big5 ��中�� Unicode ��中��转
gbk-trad GBK ��中�� Unicode ��中��转

��� GBK � Big5 ���转, 请��该模���� b2g.pl � g2b.pl 两���,
�����使�����:

use Encode::HanConvert;
$euc_cn = big5_to_gb($big5); # � Big5 转为 GBK
$big5 = gb_to_big5($euc_cn); # � GBK 转为 Big5

=head2 ��步�信�

请�� Perl ���大�说��件 (�幸�������), �学习����
Perl ���, 以� Unicode �使���. ��, �������丰�:

=head2 �� Perl �����

=over 4

=item L<http://www.perl.com/>

Perl ��页 (�欧�礼��维�)

=item L<http://www.cpan.org/>

Perl 综���� (Comprehensive Perl Archive Network)

=item L<http://lists.perl.org/>

Perl ��论���

=back

=head2 学习 Perl ���

=over 4

=item L<http://www.oreilly.com.cn/html/perl.html>

��中���欧�礼 Perl 书�

=back

=head2 Perl 使����

=over 4

=item L<http://www.pm.org/groups/asia.html>

中� Perl �广���

=back

=head2 Unicode ����

=over 4

=item L<http://www.unicode.org/>

Unicode 学�学� (Unicode ������)

=item L<http://www.cl.cam.ac.uk/%7Emgk25/unicode.html>

Unix/Linux �� UTF-8 � Unicode �客�

=back

=head1 SEE ALSO

L<Encode>, L<Encode::CN>, L<encoding>, L<perluniintro>, L<perlunicode>

=head1 AUTHORS

Jarkko Hietaniemi E<lt>[email protected]<gt>

Audrey Tang (å��å�¤) E<lt>[email protected]<gt>

=cut