| 1 |
NAME |
| 2 |
Encode::HanExtra - Extra sets of Chinese encodings |
| 3 |
|
| 4 |
VERSION |
| 5 |
This document describes version 0.23 of Encode::HanExtra, released |
| 6 |
November 10, 2007. |
| 7 |
|
| 8 |
SYNOPSIS |
| 9 |
use Encode; |
| 10 |
|
| 11 |
# Traditional Chinese |
| 12 |
$euc_tw = encode("euc-tw", $utf8); # loads Encode::HanExtra implicitly |
| 13 |
$utf8 = decode("euc-tw", $euc_tw); # ditto |
| 14 |
|
| 15 |
# Simplified Chinese |
| 16 |
$gb18030 = encode("gb18030", $utf8); # loads Encode::HanExtra implicitly |
| 17 |
$utf8 = decode("gb18030", $gb18030); # ditto |
| 18 |
|
| 19 |
DESCRIPTION |
| 20 |
Perl 5.7.3 and later ships with an adequate set of Chinese encodings, |
| 21 |
including the commonly used "CP950", "CP936" (also known as "GBK"), |
| 22 |
"Big5" (alias for "Big5-Eten"), "Big5-HKSCS", "EUC-CN", "HZ", and |
| 23 |
"ISO-IR-165". |
| 24 |
|
| 25 |
However, the numbers of Chinese encodings are staggering, and a complete |
| 26 |
coverage will easily increase the size of perl distribution by several |
| 27 |
megabytes; hence, this CPAN module tries to provide the rest of them. |
| 28 |
|
| 29 |
If you are using Perl 5.8 or later, Encode::CN and Encode::TW will |
| 30 |
automatically load the extra encodings for you, so there's no need to |
| 31 |
explicitly write "use Encode::HanExtra" if you are using one of them |
| 32 |
already. |
| 33 |
|
| 34 |
ENCODINGS |
| 35 |
This version includes the following encoding tables: |
| 36 |
|
| 37 |
Canonical Alias Description |
| 38 |
----------------------------------------------------------------------------- |
| 39 |
big5-1984 /\b(tca-)?big5-?(19)?84$/i TCA's original Big5-1984 |
| 40 |
big5-2003 /\b(cmex-)?big5-?(20)?03$/i Big5-2003 (national standard) |
| 41 |
big5ext /\b(cmex-)?big5-?e(xt)?$/i CMEX's Big5e Extension |
| 42 |
big5plus /\b(cmex-)?big5-?p(lus)?$/i CMEX's Big5+ Extension |
| 43 |
/\b(cmex-)?big5\+$/i |
| 44 |
cccii /\b(ccag-)?cccii$/i Chinese Character Code for |
| 45 |
Information Interchange |
| 46 |
cns11643-1 /\bCNS[-_ ]?11643[-_]1$/i Taiwan's CNS map, plane 1 |
| 47 |
cns11643-2 /\bCNS[-_ ]?11643[-_]2$/i Taiwan's CNS map, plane 2 |
| 48 |
cns11643-3 /\bCNS[-_ ]?11643[-_]3$/i Taiwan's CNS map, plane 3 |
| 49 |
cns11643-4 /\bCNS[-_ ]?11643[-_]4$/i Taiwan's CNS map, plane 4 |
| 50 |
cns11643-5 /\bCNS[-_ ]?11643[-_]5$/i Taiwan's CNS map, plane 5 |
| 51 |
cns11643-6 /\bCNS[-_ ]?11643[-_]6$/i Taiwan's CNS map, plane 6 |
| 52 |
cns11643-7 /\bCNS[-_ ]?11643[-_]7$/i Taiwan's CNS map, plane 7 |
| 53 |
cns11643-f /\bCNS[-_ ]?11643[-_]f$/i Taiwan's CNS map, plane F |
| 54 |
euc-tw /\beuc.*tw$/i EUC (Extended Unix Character) |
| 55 |
/\btw.*euc$/i |
| 56 |
gb18030 /\bGB[-_ ]?18030$/i GBK with Traditional Characters |
| 57 |
unisys /\bunisys$/i Unisys Traditional Chinese |
| 58 |
unisys-sosi1 Unisys SOSI1 transport encoding |
| 59 |
unisys-sosi2 Unisys SOSI2 transport encoding |
| 60 |
|
| 61 |
Detailed descriptions are as follows: |
| 62 |
|
| 63 |
BIG5-1984 |
| 64 |
This is the original Big5 encoding made by TCA Taiwan. |
| 65 |
|
| 66 |
BIG5-2003 |
| 67 |
This revised encoding is now national standard, as an appendix of |
| 68 |
CNS11643. |
| 69 |
|
| 70 |
BIG5PLUS |
| 71 |
This encoding, while not heavily used, is an attempt to bring all |
| 72 |
Taiwan's conflicting internal-use encodings together, and fit it as |
| 73 |
an extension to the widely-deployed Big5 range, by CMEX Taiwan. |
| 74 |
|
| 75 |
BIG5EXT |
| 76 |
The CMEX's second (and less ambitious) try at unifying the most |
| 77 |
commonly used characters not covered by Big5, while not polluting |
| 78 |
out of the 94x94 arragement like BIG5PLUS did. |
| 79 |
|
| 80 |
CCCII |
| 81 |
The earliest (and most sophisticated) Traditional Chinese encoding, |
| 82 |
with a three-byte raw character map, made in 1980 by the Chinese |
| 83 |
Character Analysis Group (CCAG), used mostly in library systems. |
| 84 |
|
| 85 |
EUC-TW |
| 86 |
The EUC transport version of "CNS11643" (planes 1-7), the |
| 87 |
comprehensive character set used by the Taiwan government. |
| 88 |
|
| 89 |
CNS11643-* |
| 90 |
The raw character map extracted from the Unihan database, including |
| 91 |
the plane F which wasn't included in "EUC-TW". |
| 92 |
|
| 93 |
GB18030 |
| 94 |
An extension to GBK, this encoding lists most Han characters (both |
| 95 |
simplified and traditional), as well as some other encodings used by |
| 96 |
other peoples in China. |
| 97 |
|
| 98 |
UNISYS |
| 99 |
Unisys System's internal Chinese mapping. |
| 100 |
|
| 101 |
NOTES |
| 102 |
If you are looking for ways to transliterate between Simplified and |
| 103 |
Traditional Chinese, please take a look at Encode::HanConvert. Note that |
| 104 |
the direct mapping via Unicode is lossy, and usually doesn't work at |
| 105 |
all. |
| 106 |
|
| 107 |
Please send me suggestions if you want to see more encoding added, such |
| 108 |
as "BIG5-GCCS" (superseded by "BIG5-HKSCS"). Other suggestions are |
| 109 |
welcome, too. |
| 110 |
|
| 111 |
SEE ALSO |
| 112 |
Encode, Encode::HanConvert |
| 113 |
|
| 114 |
ACKNOWLEDGEMENTS |
| 115 |
Some of the maps here are generated from GNU libiconv's test files, with |
| 116 |
kind permission from Bruno Haible. |
| 117 |
|
| 118 |
Map for "BIG5PLUS" is generated from the BIG52UCS.TXT file, courtesy of |
| 119 |
CMEX Taiwan (Chinese Microcomputer Extended Foundation, |
| 120 |
<http://www.cmex.org.tw/>). |
| 121 |
|
| 122 |
Map for "BIG5-1984" is supplied by imacat. |
| 123 |
|
| 124 |
Map for "CCCII" is supplied by the Koha Taiwan project. |
| 125 |
|
| 126 |
AUTHORS |
| 127 |
Audrey Tang <[email protected]> |
| 128 |
|
| 129 |
COPYRIGHT |
| 130 |
Copyright 2002-2007 by Audrey Tang <[email protected]>. |
| 131 |
|
| 132 |
This software is released under the MIT license cited below. |
| 133 |
|
| 134 |
The "MIT" License |
| 135 |
Permission is hereby granted, free of charge, to any person obtaining a |
| 136 |
copy of this software and associated documentation files (the |
| 137 |
"Software"), to deal in the Software without restriction, including |
| 138 |
without limitation the rights to use, copy, modify, merge, publish, |
| 139 |
distribute, sublicense, and/or sell copies of the Software, and to |
| 140 |
permit persons to whom the Software is furnished to do so, subject to |
| 141 |
the following conditions: |
| 142 |
|
| 143 |
The above copyright notice and this permission notice shall be included |
| 144 |
in all copies or substantial portions of the Software. |
| 145 |
|
| 146 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 147 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 148 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 149 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 150 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 151 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 152 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 153 |
|