Encode::CN(3pm)
hey bestie π you just opened Encode::CN(3pm) from the Perl Programmers Reference Guide, and itβs giving China-based Chinese encodings in the cutest possible way. no cap, every single detail is staying. π«Ά
πΈ NAME πΈ
Encode::CN β China-based Chinese Encodings β¨
β¨ SYNOPSIS β¨
okay so the vibe check is: you load Encode, then encode/decode like this:
use Encode qw/encode decode/;
$euc_cn = encode("euc-cn", $utf8); # loads Encode::CN implicitly
$utf8 = decode("euc-cn", $euc_cn); # ditto
the first call loads Encode::CN implicitly, and the second one is ditto β literally what the comments say. π
π DESCRIPTION π
this module implements China-based Chinese charset encodings. here are the supported encodings, with canonical name, alias, and description all accounted for:
euc-cnβ aliases:/\beuc.*cn$/i,/\bcn.*euc$/i,/\bGB[-_ ]?2312(?:\D.*$|$)/i(see below). description: EUC (Extended Unix Character). πgb2312-rawβ no alias listed in the table. description: The raw (low-bit) GB2312 character map.gb12345-rawβ no alias listed in the table. description: Traditional chinese counterpart to GB2312 (raw).iso-ir-165β no alias listed in the table. description: GB2312 + GB6345 + GB8565 + additions.MacChineseSimpβ no alias listed in the table. description: GB2312 + Apple Additions.cp936β no alias listed in the table. description: Code Page 936, also known as GBK (Extended GuoBiao).hzβ no alias listed in the table. description: 7-bit escaped GB2312 encoding.
to find how to use this module in detail, see Encode. π¦
π NOTES π
due to size concerns, "GB 18030" (an extension to "GBK") is distributed separately on CPAN, under the name Encode::HanExtra. that module also contains extra Taiwan-based encodings. π
π BUGS π
when you see charset=gb2312 on mails and web pages, they really mean euc-cn encodings β yes, for real. to fix that, gb2312 is aliased to euc-cn. use gb2312-raw when you really mean it. π
the ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium. β οΈ
π SEE ALSO π
Encode β thatβs the one. go read it, bestie. π«Ά
okay thatβs the whole page, periodt π
kisses from source/version perl v5.42.3, dated 2026-11-03, and this was the Encode::CN(3pm) manual. ππ₯
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms