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
  • big5-hkscs β€” Big5 + Cantonese characters in Hong Kong
    • aliases: /\bbig5-?hk(scs)?$/i, /\bhk(scs)?-?big5$/i
  • 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