Encode::JISX0213(3)

๐Ÿ“ฆ
version 0.04 ยท 2 versions
, in fedora 43

โœจ Encode::JISX0213 ๐Ÿ’–

okay bestie, so this page is from the User Contributed Perl Documentation collection, and it's all about the module Encode::JISX0213 โ€” aka the JIS X 0213 encodings. yes it's giving niche encoding nerdery and yes it's iconic. let's get into it ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

Encode::JISX0213 โ€” JIS X 0213 encodings. that's it. that's the name. short, sweet, slays ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

here's the whole vibe in four lines, no cap:

use Encode::JISX0213;
use Encode qw/encode decode/;
$byte = encode("iso-2022-jp-2004", $utf8);
$utf8 = decode("iso-2022-jp-2004", $byte);

like, you load the module, you pull in encode and decode, and then you just... do the thing. encode a UTF-8 string into bytes, decode bytes back into a UTF-8 string. periodt โœจ


๐ŸŒˆ ABSTRACT ๐ŸŒˆ

so this module hands you the following encodings, and I'm gonna lay them out one by one because we do NOT skip details in this house ๐Ÿซถ

the JIS X 0213:2004 lineup:

  • euc-jis-2004 โ€” aliases: qr/\beuc-?(jis|jp)-?2004$/i โ€” it's an 8-bit encoding ๐Ÿ’œ
  • iso-2022-jp-2004 โ€” aliases: qr/\biso-?2022-?jp-?2004$/i โ€” it's a 7-bit encoding โญ
  • and if you wanna know about "shift encoding", bestie, go read Encode::ShiftJIS2004. iykyk ๐Ÿ’€

plus, for the older revision, JIS X 0213:2000:

  • euc-jisx0213 โ€” aliases: qr/\beucjisx0213$/i, qr/\beuc.*jp[ \-]?(?:2000|2k)$/i, qr/\bjp.*euc[ \-]?(2000|2k)$/i, qr/\bujis[ \-]?(?:2000|2k)$/i โ€” an 8-bit encoding ๐ŸŒธ
  • iso-2022-jp-3 โ€” aliases: qr/\biso-?2022-?jp-?3$/i โ€” a 7-bit encoding ๐ŸŽ€

and for transitioning from legacy standards (yes, the messy exes of encodings):

  • x-iso2022jp2004-compatible โ€” alias: qr/\biso-?2022-?jp-?2004-?compatible$/i โ€” see the note down in DESCRIPTION ๐Ÿ‘€
  • x-iso2022jp2004-strict โ€” alias: qr/\biso-?2022-?jp-?2004-?strict$/i โ€” also see the note ๐Ÿ’…

๐Ÿ’– DESCRIPTION ๐Ÿ’–

to find out how to use this module in detail, see Encode. that's the whole paragraph. go read Encode, bestie, it's the main character of this friend group ๐Ÿ‘‘

๐ŸŒŸ Notes on Compatibility ๐ŸŒŸ

okay so here's where it gets juicy. buckle up ๐Ÿ“

to encode a Unicode string into a byte string, x-iso2022jp2004-strict uses JIS X 0208 as much as possible, strictly conforming to JIS X 0213:2004 Annex 2. and the slay part? it's compatible with other encodings โœจ

x-iso2022jp2004-compatible uses JIS X 0208 for the bit combinations co-existing on JIS X 0208 and JIS X 0213 plane 1. but ngl, it is not compatible with other encodings โ€” it had never been registered by any standards bodies. it's giving rogue behavior ๐Ÿ’€

however (and this is the plot twist), to decode a byte string into a Unicode string, the encodings in the tables above accept arbitrary sequences of both JIS X 0208 and JIS X 0213. the exception is x-iso2022jp2004-strict: it accepts only allowed JIS X 0208 sequences. strict means strict, no exceptions ๐Ÿ™ˆ

euc-jis-2004 and euc-jisx0213 contain JIS X 0213 plane 2 along with JIS X 0212 in G3. and because of this non-standard extension, they have forward compatibility with EUC-JP (AJEC) in the case of decoding. we love a lil bonus feature ๐ŸŽ€

๐Ÿฆ„ Comparison with Other Modules ๐Ÿฆ„

Encode::JIS2K provides euc-jisx0213, iso-2022-jp-3 and shift_jisx0213 encodings. also, euc-jp in Encode::JP 1.64 or later can decode euc-jisx0213 sequences. but here's the tea: they support an earlier revision of the standard, and they lack the function to encode sequences with multiple Unicode characters โ€” like katakana with a semi-voiced sound mark. rip to them honestly ๐Ÿ˜ญ

ShiftJIS::X0213::MapUTF provides shift_jisx0213 and shift_jis-2004. and the catch? it does not provide an interface to the contemporary Encode module. so like, no shade, but it's not fitting in with the modern crowd ๐Ÿ’…


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

  • JIS X 0213:2000 7ใƒ“ใƒƒใƒˆๅŠใณ8ใƒ“ใƒƒใƒˆใฎ2ใƒใ‚คใƒˆๆƒ…ๅ ฑไบคๆ›็”จ็ฌฆๅทๅŒ–ๆ‹กๅผตๆผขๅญ—้›†ๅˆ (7-bit and 8-bit double byte coded extended KANJI sets for information interchange), and its amendment JIS X 0213:2000/Amd.1:2004.
  • Encode, Encode::JP, Encode::ShiftJIS2004.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu> ๐Ÿ’œ


Copyright (C) 2013, 2015 Hatuka*nezumi - IKEDA Soji.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie!! this one came from perl v5.42.0, dated 2025-07-25, and it's the Encode::JISX0213(3) manpage โ€” read it, love it, encode responsibly ๐ŸŒˆ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from