1*0Sstevel@tonic-gatepackage Encode::CN; 2*0Sstevel@tonic-gateBEGIN { 3*0Sstevel@tonic-gate if (ord("A") == 193) { 4*0Sstevel@tonic-gate die "Encode::CN not supported on EBCDIC\n"; 5*0Sstevel@tonic-gate } 6*0Sstevel@tonic-gate} 7*0Sstevel@tonic-gateour $VERSION = do { my @r = (q$Revision: 1.24 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gateuse Encode; 10*0Sstevel@tonic-gateuse XSLoader; 11*0Sstevel@tonic-gateXSLoader::load(__PACKAGE__,$VERSION); 12*0Sstevel@tonic-gate 13*0Sstevel@tonic-gate# Relocated from Encode.pm 14*0Sstevel@tonic-gate 15*0Sstevel@tonic-gateuse Encode::CN::HZ; 16*0Sstevel@tonic-gate# use Encode::CN::2022_CN; 17*0Sstevel@tonic-gate 18*0Sstevel@tonic-gate1; 19*0Sstevel@tonic-gate__END__ 20*0Sstevel@tonic-gate 21*0Sstevel@tonic-gate=head1 NAME 22*0Sstevel@tonic-gate 23*0Sstevel@tonic-gateEncode::CN - China-based Chinese Encodings 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gate=head1 SYNOPSIS 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate use Encode qw/encode decode/; 28*0Sstevel@tonic-gate $euc_cn = encode("euc-cn", $utf8); # loads Encode::CN implicitly 29*0Sstevel@tonic-gate $utf8 = decode("euc-cn", $euc_cn); # ditto 30*0Sstevel@tonic-gate 31*0Sstevel@tonic-gate=head1 DESCRIPTION 32*0Sstevel@tonic-gate 33*0Sstevel@tonic-gateThis module implements China-based Chinese charset encodings. 34*0Sstevel@tonic-gateEncodings supported are as follows. 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate Canonical Alias Description 37*0Sstevel@tonic-gate -------------------------------------------------------------------- 38*0Sstevel@tonic-gate euc-cn /\beuc.*cn$/i EUC (Extended Unix Character) 39*0Sstevel@tonic-gate /\bcn.*euc$/i 40*0Sstevel@tonic-gate /\bGB[-_ ]?2312(?:\D.*$|$)/i (see below) 41*0Sstevel@tonic-gate gb2312-raw The raw (low-bit) GB2312 character map 42*0Sstevel@tonic-gate gb12345-raw Traditional chinese counterpart to 43*0Sstevel@tonic-gate GB2312 (raw) 44*0Sstevel@tonic-gate iso-ir-165 GB2312 + GB6345 + GB8565 + additions 45*0Sstevel@tonic-gate MacChineseSimp GB2312 + Apple Additions 46*0Sstevel@tonic-gate cp936 Code Page 936, also known as GBK 47*0Sstevel@tonic-gate (Extended GuoBiao) 48*0Sstevel@tonic-gate hz 7-bit escaped GB2312 encoding 49*0Sstevel@tonic-gate -------------------------------------------------------------------- 50*0Sstevel@tonic-gate 51*0Sstevel@tonic-gateTo find how to use this module in detail, see L<Encode>. 52*0Sstevel@tonic-gate 53*0Sstevel@tonic-gate=head1 NOTES 54*0Sstevel@tonic-gate 55*0Sstevel@tonic-gateDue to size concerns, C<GB 18030> (an extension to C<GBK>) is distributed 56*0Sstevel@tonic-gateseparately on CPAN, under the name L<Encode::HanExtra>. That module 57*0Sstevel@tonic-gatealso contains extra Taiwan-based encodings. 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate=head1 BUGS 60*0Sstevel@tonic-gate 61*0Sstevel@tonic-gateWhen you see C<charset=gb2312> on mails and web pages, they really 62*0Sstevel@tonic-gatemean C<euc-cn> encodings. To fix that, C<gb2312> is aliased to C<euc-cn>. 63*0Sstevel@tonic-gateUse C<gb2312-raw> when you really mean it. 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gateThe ASCII region (0x00-0x7f) is preserved for all encodings, even though 66*0Sstevel@tonic-gatethis conflicts with mappings by the Unicode Consortium. See 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gateL<http://www.debian.or.jp/~kubota/unicode-symbols.html.en> 69*0Sstevel@tonic-gate 70*0Sstevel@tonic-gateto find out why it is implemented that way. 71*0Sstevel@tonic-gate 72*0Sstevel@tonic-gate=head1 SEE ALSO 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gateL<Encode> 75*0Sstevel@tonic-gate 76*0Sstevel@tonic-gate=cut 77