3 if ( ord("A") == 193 ) {
4 die "Encode::CN not supported on EBCDIC\n";
10 our $VERSION = do { my @r = ( q$Revision: 2.2 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
12 XSLoader::load( __PACKAGE__, $VERSION );
14 # Relocated from Encode.pm
18 # use Encode::CN::2022_CN;
25 Encode::CN - China-based Chinese Encodings
29 use Encode qw/encode decode/;
30 $euc_cn = encode("euc-cn", $utf8); # loads Encode::CN implicitly
31 $utf8 = decode("euc-cn", $euc_cn); # ditto
35 This module implements China-based Chinese charset encodings.
36 Encodings supported are as follows.
38 Canonical Alias Description
39 --------------------------------------------------------------------
40 euc-cn /\beuc.*cn$/i EUC (Extended Unix Character)
42 /\bGB[-_ ]?2312(?:\D.*$|$)/i (see below)
43 gb2312-raw The raw (low-bit) GB2312 character map
44 gb12345-raw Traditional chinese counterpart to
46 iso-ir-165 GB2312 + GB6345 + GB8565 + additions
47 MacChineseSimp GB2312 + Apple Additions
48 cp936 Code Page 936, also known as GBK
50 hz 7-bit escaped GB2312 encoding
51 --------------------------------------------------------------------
53 To find how to use this module in detail, see L<Encode>.
57 Due to size concerns, C<GB 18030> (an extension to C<GBK>) is distributed
58 separately on CPAN, under the name L<Encode::HanExtra>. That module
59 also contains extra Taiwan-based encodings.
63 When you see C<charset=gb2312> on mails and web pages, they really
64 mean C<euc-cn> encodings. To fix that, C<gb2312> is aliased to C<euc-cn>.
65 Use C<gb2312-raw> when you really mean it.
67 The ASCII region (0x00-0x7f) is preserved for all encodings, even though
68 this conflicts with mappings by the Unicode Consortium. See
70 L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
72 to find out why it is implemented that way.