Skip to content

Commit

Permalink
README.cjk update.
Browse files Browse the repository at this point in the history
p4raw-id: //depot/perl@15980
  • Loading branch information
jhi committed Apr 17, 2002
1 parent da6eeda commit f092799
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 232 deletions.
65 changes: 37 additions & 28 deletions README.cn
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ specially designed to be readable as is.

The following documentation is written in EUC-CN encoding.

?�?����һ������ֱ༭����������ĵ�, ������������ص�ע���ַ�. �����
������ POD (�����ĵ���ʽ) д��; ���ָ�ʽ��Ϊ����?���ֱ�Ӷ�ȡ���ر���?
��. ���ڴ˸�ʽ�Ľ�һ����Ѷ, ��ο� perlpod �����ĵ�.
������һ������ֱ༭����������ļ�, ������������ص�ע���ַ�.
����ļ����� POD (�����ļ���ʽ) д��; ���ָ�ʽ��Ϊ�������ֱ�Ӷ�ȡ,
���ر���Ƶ�. ���ڴ˸�ʽ�Ľ�һ����Ϣ, ��ο� perlpod �����ļ�.

=head1 NAME

Expand All @@ -16,16 +16,16 @@ perlcn -

��ӭ���� 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 ����ģ��֧Ԯ���м������ĵı��뷽ʽ:

Expand All @@ -36,46 +36,51 @@ 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 ģ��, ���������д�����ַ�Ϊ��λ�ij�����, ?������?:
����, ���� encoding ģ��, ���������д�����ַ�Ϊ��λ�ij�����, ������ʾ:

#!/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 ��Դ����ַ
Expand Down Expand Up @@ -130,6 +135,10 @@ Unix/Linux

=back

=head1 SEE ALSO

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

=head1 AUTHORS

Jarkko Hietaniemi E<lt>[email protected]<gt>
Expand Down
6 changes: 3 additions & 3 deletions README.jp
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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 FOO encoding.
The following documentation is written in euc-jp encoding.

=head1 NAME

perljp - ���ܸ� Perl ������

=head1 ����

�褦���� Perl ��!
Perl �������ؤ褦����!

Perl 5.8.0 ��ꡢUnicode���ݡ��Ȥ������˶������졢���η�̥�ƥ�ʸ���ʳ���ʸ�������ɤΥ��ݡ��Ȥ� CJK (���졢���ܸ졢�ϥ󥰥�)��ޤ�Ʋä��ޤ�����Unicode���������ʸ�����Ĥ�ʸ�������ɤǰ������Ȥ��ܻؤ���ɸ�൬�ʤǤ��ꡢ�줫�������Ϥ��ޤ����δ֤�ʸ���ʥ��ꥷ��ʸ�������꡼��ʸ��������ӥ�ʸ�����إ֥饤ʸ�����ǥ��������ʥ�����ʸ�����ʤɤʤɡˤ䡢����ޤǤ�OS�٥�������ȼ������Ƥ���ʸ��(PC�����Macintosh)�����Ǥ˴ޤޤ�Ƥ��ޤ���

Expand Down Expand Up @@ -71,7 +71,7 @@ Perl5.8

=item *

��������
������

�ʲ�����Ϥ��Ť��Shift_JIS�����Ϥ�EUC-JP���Ѵ����ƽ��Ϥ��ޤ���

Expand Down
Loading

0 comments on commit f092799

Please sign in to comment.