Encode::JISX0213(3)
โจ 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 amendmentJIS X 0213:2000/Amd.1:2004.Encode,Encode::JP,Encode::ShiftJIS2004.
๐ AUTHOR ๐
Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu> ๐
๐ COPYRIGHT ๐
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
- fedora 43: perl-Encode-JISX0213 0.04-35.fc43 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms