Encode::TW(3perl)
π Encode::TW β Taiwan-based Chinese Encodings π
okay bestie, welcome to the Taiwan/Hong Kong Chinese encoding module, no cap π«Ά
β¨ NAME β¨
Encode::TW β Taiwan-based Chinese Encodings πΉπΌ
πΈ SYNOPSIS πΈ
use Encode qw/encode decode/;
$big5 = encode("big5", $utf8); # loads Encode::TW implicitly
$utf8 = decode("big5", $big5); # ditto
see how it just happens? encode("big5", ...) pulls in Encode::TW all by itself, no extra use needed. it's giving main character energy fr fr β¨
π DESCRIPTION π
This module implements the traditional Chinese charset encodings, the ones actually used over in Taiwan and Hong Kong. Here's the whole lineup, and yes you need to know all of them π
big5-etenβ Big5 encoding (with ETen extensions)- aliases:
/\bbig-?5$/i,/\bbig5-?et(en)?$/i,/\btca-?big5$/i
- aliases:
big5-hkscsβ Big5 + Cantonese characters in Hong Kong- aliases:
/\bbig5-?hk(scs)?$/i,/\bhk(scs)?-?big5$/i
- aliases:
MacChineseTradβ Big5 + Apple Vendor Mappings πcp950β Code Page 950 = Big5 + Microsoft vendor mappings πͺ
Wanna know how to actually use this module in detail? go read Encode bestie, it's all there π
π NOTES π
okay so, due to size concerns (she's big, your honor), these four are shipped separately on CPAN instead of living here:
EUC-TW(Extended Unix Character)CCCII(Chinese Character Code for Information Interchange)BIG5PLUS(CMEX's Big5+)BIG5EXT(CMEX's Big5e)
They all hang out in a CPAN distribution called Encode::HanExtra, and that module also has extra China-based encodings in it too. so if you're missing one, that's where she is π§
π BUGS π
okay so here's the lore. the original "big5" encoding from 1984 is literally not supported anywhere:
- glibc and DOS-based systems use
"big5"to mean"big5-eten" - Microsoft uses
"big5"to mean"cp950"
so a conscious decision was made (deliberate, on purpose, we knew) to alias "big5" to "big5-eten", because that one is the de facto superset of the original big5. periodt π
The "CNS11643" encoding files are not complete. for common "CNS11643" manipulation, please use "EUC-TW" in Encode::HanExtra, which contains planes 1-7. don't come crying to me when the incomplete one doesn't have your character π
The ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium. yes, it's a little messy, we know π
π SEE ALSO π
Encode β
lowkey obsessed with you for reading the whole thing π₯Ή that's the whole module. slay. π
perl v5.44.0 β¨ 2026-10-17 β¨ and that's the whole Encode::TW(3perl) page, from the Perl Programmers Reference Guide, no cap ππ
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms