Encode::KR(3perl)

πŸ’– Encode::KR β€” Korean Encodings πŸ’–

okay bestie, gather round, because this is the little module that handles all the Korean charsets, and she is lowkey carrying the whole group chat. This page lives in the Perl Programmers Reference Guide as Encode::KR(3perl) β€” yes she has her own man page, main character energy fr fr. πŸ‘‘


✨ SYNOPSIS ✨

use Encode qw/encode decode/;
$euc_kr = encode("euc-kr", $utf8);   # loads Encode::KR implicitly
$utf8   = decode("euc-kr", $euc_kr); # ditto

see how chill that is? you don't even have to use her directly, she just shows up when you call her name. it's giving "I'll be there before you finish texting" 🫢


🌸 DESCRIPTION 🌸

so this module implements Korean charset encodings. the ones she supports are, in her own words:

  • euc-kr β€” aliases: /\beuc.*kr$/i and /\bkr.*euc$/i β€” EUC (Extended Unix Character) πŸ’…
  • ksc5601-raw β€” Korean standard code set (as is). no alias, she's unbothered, she's raw, she's authentic ✨
  • cp949 β€” aliases: /(?:x-)?uhc$/i, /(?:x-)?windows-949$/i, and /\bks_c_5601-1987$/i β€” Code Page 949 (EUC-KR + 8,822 (additional Hangul syllables)) πŸŽ€
  • MacKorean β€” EUC-KR + Apple Vendor Mappings πŸ“
  • johab β€” alias: JOHAB β€” a supplementary encoding defined in Annex 3 of KS X 1001:1998 🌈
  • iso-2022-kr β€” alias: iso-2022-kr β€” [RFC1557] πŸ¦‹

and if you wanna know how to use this module in detail detail, go read Encode. she's the big sister page, she has the lore. πŸ“š


😭 BUGS 😭

okay so listen. when you see charset=ks_c_5601-1987 on mails and web pages? bestie. they really mean cp949 encodings. not a vibe, not a drill, just a whole identity crisis happening out there in the wild. 🫠

to fix that, these aliases are set:

qr/(?:x-)?uhc$/i         => '"cp949"'
qr/(?:x-)?windows-949$/i => '"cp949"'
qr/ks_c_5601-1987$/i     => '"cp949"'

and also, important one: the ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium. so like… she said what she said, the ASCII stays, periodt. πŸ’€

ngl this is the part where you don't argue with the module, you just say "thank you for your service" and move on πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€

  • Encode

that's the whole page, you ate that, no crumbs. πŸ’– thanks for reading, you're literally the bestie of all time, and remember: encode responsibly. 🧚

this was page Encode::KR(3perl) from perl v5.44.0, dated 2026-10-17 β€” mwah, stan, bye πŸ’…βœ¨

πŸ“¦ 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