ext/Encode/Encode/gb1988.enc Encode table
ext/Encode/Encode/gb2312.enc Encode table
ext/Encode/Encode/gsm0338.enc Encode table
-ext/Encode/Encode/HZ.enc Encode table
ext/Encode/Encode/ir-197.enc Encode table
ext/Encode/Encode/iso-ir-165.enc Encode table
ext/Encode/Encode/jis0201.enc Encode table
ext/Encode/JP/Makefile.PL Encode extension
ext/Encode/KR/KR.pm Encode extension
ext/Encode/KR/Makefile.PL Encode extension
+ext/Encode/lib/Encode/CN/HZ.pm Encode table
ext/Encode/lib/Encode/Encoding.pm Encode extension
ext/Encode/lib/Encode/Internal.pm Encode extension
ext/Encode/lib/Encode/iso10646_1.pm Encode extension
lib/Math/BigInt/t/config.t Test Math::BigInt->config()
lib/Math/BigInt/t/constant.t Test Math::BigInt/BigFloat under :constant
lib/Math/BigInt/t/downgrade.t Test if use Math::BigInt(); under downgrade works
-lib/Math/BigInt/t/isa.t Test for Math::BigInt inheritance
lib/Math/BigInt/t/inf_nan.t Special tests for inf and NaN handling
+lib/Math/BigInt/t/isa.t Test for Math::BigInt inheritance
lib/Math/BigInt/t/mbimbf.inc Actual BigInt/BigFloat accuracy, precicion and fallback, round_mode tests
lib/Math/BigInt/t/mbimbf.t BigInt/BigFloat accuracy, precicion and fallback, round_mode
lib/Math/BigInt/t/require.t Test if require Math::BigInt works
package Encode::CN;
-use Encode;
our $VERSION = '0.02';
+
+use Encode;
+use Encode::CN::HZ;
use XSLoader;
XSLoader::load('Encode::CN',$VERSION);
+local $@;
+eval "use Encode::HanExtra"; # load extra encodings if they exist
+
1;
__END__
=head1 NAME
gb2312 The raw (low-bit) GB2312 character map
gb12345 Traditional chinese counterpart to GB2312 (raw)
iso-ir-165 GB2312 + GB6345 + GB8565 + additions
- cp936 Code Page 936, also known as GBK (Extended GuoBiao)
+ cp936 Code Page 936, also known as GBK (Extended GuoBiao)
+ hz 7-bit escaped GB2312 encoding
To find how to use this module in detail, see L<Encode>.
separately on CPAN, under the name L<Encode::HanExtra>. That module
also contains extra Taiwan-based encodings.
-=head1 BUGS
+This module will automatically load L<Encode::HanExtra> if you have it on
+your machine.
-The C<HZ> (Hanzi) escaped encoding is not supported.
+=head1 BUGS
ASCII part (0x00-0x7f) is preserved for all encodings, even though it
conflicts with mappings by the Unicode Consortium. See
# TODO: HP-UX '8' encodings arabic8 greek8 hebrew8 kana8 thai8 turkish8
# TODO: HP-UX '15' encodings japanese15 korean15 roi15
# TODO: Cyrillic encoding ISO-IR-111 (useful?)
-# TODO: Chinese encodings HZ
# TODO: Armenian encoding ARMSCII-8
# TODO: Hebrew encoding ISO-8859-8-1
# TODO: Thai encoding TCVN
+++ /dev/null
-# Encoding file: HZ, HanZi
-H
-name HZ
-init {}
-final {}
-ascii \x7e\x7d
-gb2312 \x7e\x7b
package Encode::KR;
-use Encode;
our $VERSION = '0.02';
+
+use Encode;
use XSLoader;
XSLoader::load('Encode::KR',$VERSION);
euc-kr EUC (Extended Unix Character)
ksc5601 Korean standard code set
- cp949 Code Page 949 (EUC-KR + Unified Hangul Code)
+ cp949 Code Page 949 (EUC-KR + Unified Hangul Code)
To find how to use this module in detail, see L<Encode>.
Encode/gb1988.enc
Encode/gb2312.enc
Encode/gsm0338.enc
-Encode/HZ.enc
Encode/iso-ir-165.enc
Encode/ir-197.enc
Encode/jis0201.enc
lib/Encode/Unicode.pm
lib/Encode/utf8.pm
lib/Encode/XS.pm
+lib/Encode/CN/HZ.pm
lib/Encode/Tcl/Escape.pm
lib/Encode/Tcl/Extended.pm
lib/Encode/Tcl/HanZi.pm
package Encode::TW;
-use Encode;
our $VERSION = '0.02';
+
+use Encode;
use XSLoader;
XSLoader::load('Encode::TW',$VERSION);
+local $@;
+eval "use Encode::HanExtra"; # load extra encodings if they exist
+
1;
__END__
=head1 NAME
big5 The original Big5 encoding
big5-hkscs Big5 plus Cantonese characters in Hong Kong
- cp950 Code Page 950 (Big5 + Microsoft vendor mappings)
+ cp950 Code Page 950 (Big5 + Microsoft vendor mappings)
To find how to use this module in detail, see L<Encode>.
(CMEX's Big5+) are distributed separately on CPAN, under the name
L<Encode::HanExtra>. That module also contains extra China-based encodings.
+This module will automatically load L<Encode::HanExtra> if you have it on
+your machine.
+
=head1 BUGS
The C<CNS11643> encoding files are not complete (only the first two planes,
--- /dev/null
+package Encode::CN::HZ;
+
+use Encode::CN;
+use Encode qw|encode decode|;
+use base 'Encode::Encoding';
+
+use strict;
+
+# HZ is but escaped GB, so we implement it with the
+# GB2312(raw) encoding here. Cf. RFC 1842 & 1843.
+
+my $canon = 'hz';
+my $obj = bless {name => $canon}, __PACKAGE__;
+$obj->Define($canon);
+
+sub decode
+{
+ my ($obj,$str,$chk) = @_;
+ my $gb = Encode::find_encoding('gb2312');
+
+ $str =~ s{~(?:(~)|\n|{([^~]*)~}|)}
+ {$1 ? '~' : defined $2 ? $gb->decode($2, $chk) : ''}eg;
+
+ return $str;
+}
+
+sub encode
+{
+ my ($obj,$str,$chk) = @_;
+ my $gb = Encode::find_encoding('gb2312');
+
+ $str =~ s/~/~~/g;
+ $str =~ s/((?:
+ \p{InCJKCompatibility}|
+ \p{InCJKCompatibilityForms}|
+ \p{InCJKCompatibilityIdeographs}|
+ \p{InCJKCompatibilityIdeographsSupplement}|
+ \p{InCJKRadicalsSupplement}|
+ \p{InCJKSymbolsAndPunctuation}|
+ \p{InCJKUnifiedIdeographsExtensionA}|
+ \p{InCJKUnifiedIdeographs}|
+ \p{InCJKUnifiedIdeographsExtensionB}|
+ \p{InEnclosedCJKLettersAndMonths}
+ )+)/'~{'.$gb->encode($1, $chk).'~}'/egx;
+
+ return $str;
+}
+
+1;
+__END__