NAME
Encode::HanExtra - Extra sets of Chinese encodings
VERSION
This document describes version 0.04 of Encode::HanExtra, released April 18, 2002.
SYNOPSIS
use Encode;
# Traditional Chinese
$euc_tw = encode("euc-tw", $utf8); # loads Encode::HanExtra implicitly
$utf8 = decode("euc-tw", $euc_tw); # ditto
# Simplified Chinese
$gb18030 = encode("gb18030", $utf8); # loads Encode::HanExtra implicitly
$utf8 = decode("gb18030", $gb18030); # ditto
DESCRIPTION
Perl 5.7.3 and later ships with an adequate set of Chinese encodings, including the most used CP950
, CP936
(also known as GBK
), Big5
, Big5-HKSCS
, EUC-CN
, HZ
, and ISO-IR-165
.
However, the numbers of Chinese encodings are staggering, and a complete coverage will easily increase the size of perl distribution by several megabytes; hence, this CPAN module tries to provide the rest of them.
If you are using perl 5.8 or better, Encode::CN and Encode::TW will automatically load the extra encodings for you, so there's no need to explicitly write use Encode::HanExtra
if you are using one of them already.
ENCODINGS
This version includes the following encoding tables:
Canonical Alias Description
--------------------------------------------------------------------
big5plus /\bbig5-?p(lus)?$/i CMEX's extended Big5
/\bbig5\+$/i
cccii /\bcccii$/i Chinese Character Code for
Information Interchange
euc-tw /\beuc.*tw$/i EUC (Extended Unix Character)
/\btw.*euc$/i
gb18030 /\bGB[-_ ]?18030$/i GBK with Traditional Characters
Detailed descriptions are as follows:
- BIG5PLUS
-
This encoding, while not heavily used, is an attempt to bring all Taiwan's conflicting internal-use encodings together, and fit it as an extension to the widely-deployed Big5 range.
- CCCII
-
The earliest Traditional Chinese encoding, a three-byte raw character map made in 1980, used mostly in library systems.
- EUC-TW
-
The EUC transport version of
CNS11643
(planes 1-7), the comprehensive character set used by the Taiwan government. - GB18030
-
An extension to GBK, this encoding lists most Han characters (both simplified and traditional), as well as some other encodings used by other peoples in China.
NOTES
If you are looking for ways to transliterate between Simplified and Traditional Chinese, please take a look at Encode::HanConvert. Note that the direct mapping via Unicode is lossy, and usually doesn't work at all.
Please send me suggestions if you want to see the following encodings added: BIG5E
, BIG5-GCCS
, GB-GCCS
. Other suggestions are welcome, too.
SEE ALSO
ACKNOWLEDGEMENTS
Some of the maps here are generated from GNU libiconv's test files, with kind permission from Bruno Haible.
Map for BIG5PLUS
is generated from the BIG52UCS.TXT file, courtesy of CMEX Taiwan (http://wcmex.org.tw/).
AUTHORS
Autrijus Tang <autrijus@autrijus.org>
COPYRIGHT
Copyright 2002 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.