Encode::KR(3pm)

πŸ“¦
version 5.42.3 Β· 4 versions
, in alpine 3.24

🌸 NAME 🌸

Okay bestie, meet Encode::KR β€” the Korean Encodings module πŸ’–. This is the Encode::KR(3pm) page, and it’s here to spill the Korean charset encoding tea, no cap.

✨ SYNOPSIS ✨

Like, literally just:

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

πŸ’– DESCRIPTION πŸ’–

This module implements Korean charset encodings. The encodings supported are, and I quote the vibe, as follows β€” canonical name, alias, description, the whole lineup ✨:

  • euc-kr β€” aliases: /\beuc.*kr$/i, /\bkr.*euc$/i β€” EUC (Extended Unix Character) 🌈
  • ksc5601-raw β€” no alias listed β€” Korean standard code set (as is) πŸŽ€
  • cp949 β€” aliases: /(?:x-)?uhc$/i, /(?:x-)?windows-949$/i, /\bks_c_5601-1987$/i β€” Code Page 949 (EUC-KR + 8,822 (additional Hangul syllables) πŸ¦‹
  • MacKorean β€” no alias listed β€” 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] ⭐

To find how to use this module in detail, see Encode 🫢.

πŸ› BUGS πŸ›

Okay so here’s the bug-ish tea, bestie πŸ’€: when you see "charset=ks_c_5601-1987" on mails and web pages, they really mean "cp949" encodings. To fix that, the following aliases are set;

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

Also, the ASCII region (0x00-0x7f) is preserved for all encodings, even though this conflicts with mappings by the Unicode Consortium 😭. That caveat is real, fr fr.

πŸ‘€ SEE ALSO πŸ‘€

  • Encode πŸ’…

πŸ’– This page is from perl v5.42.3, dated 2026-11-03 β€” Encode::KR(3pm) bestie, slay and goodbye! πŸ«ΆπŸ’…

πŸ“¦ where this page comes from