| 1 |
NAME |
| 2 |
Encode::JIS2K - JIS X 0212 (aka JIS 2000) Encodings |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Encode::JIS2K; |
| 6 |
use Encode qw/encode decode/; |
| 7 |
$euc_2k = encode("euc-jisx0213", $utf8); |
| 8 |
$utf8 = decode("euc-jisx0213", $euc_jp); |
| 9 |
|
| 10 |
ABSTRACT |
| 11 |
This module implements encodings that covers JIS X 0213 charset (AKA JIS |
| 12 |
2000, hence the module name). Encodings supported are as follows. |
| 13 |
|
| 14 |
Canonical Alias Description |
| 15 |
-------------------------------------------------------------------- |
| 16 |
euc-jisx0213 qr/\beuc.*jp[ \-]?(?:2000|2k)$/i EUC-JISX0213 |
| 17 |
qr/\bjp.*euc[ \-]?(2000|2k)$/i |
| 18 |
qr/\bujis[ \-]?(?:2000|2k)$/i |
| 19 |
shiftjisx0213 qr/\bshift.*jis(?:2000|2k)$/i Shift_JISX0213 |
| 20 |
qr/\bsjisp \-]?(?:2000|2k)$/i |
| 21 |
|
| 22 |
iso-2022-jp-3 |
| 23 |
jis0213-1-raw JIS X 0213 plane 1, raw format |
| 24 |
jis0213-2-raw JIS X 0213 plane 2, raw format |
| 25 |
-------------------------------------------------------------------- |
| 26 |
|
| 27 |
DESCRIPTION |
| 28 |
To find out how to use this module in detail, see Encode. |
| 29 |
|
| 30 |
what is JIS X 0213 anyway? |
| 31 |
Simply put, JIS X 0213 is a rework and reorganization of JIS X 0208 and |
| 32 |
JIS X 0212. They consist of two 94x94 planes which roughly corrensponds |
| 33 |
as follows; |
| 34 |
|
| 35 |
JIS X 0213 Plane 1 = JIS X 0208 + extension |
| 36 |
JIS X 0213 Plane 2 = JIS X 0212 reorganized + extension |
| 37 |
|
| 38 |
And here is the character repertoire there of at a glance. |
| 39 |
|
| 40 |
# of codepoints Kuten Ku (rows) used |
| 41 |
-------------------------------------------------------- |
| 42 |
JIS X 0208 6,879 1..8,16..83 |
| 43 |
JIS X 0213-1 8,762 1..94 (all!) |
| 44 |
JIS X 0212 6,067 2,6..7,9..11,16..77 |
| 45 |
JIS X 0213-2 2,436 1,3..5,8,12..15,78..94 |
| 46 |
------------------------------------------------------- |
| 47 |
(JIS X0213 Total) 11,197 |
| 48 |
|
| 49 |
JIS X 0213 was designed to extend JIS X 0208 and JIS X 0212 without |
| 50 |
being imcompatible to (classic) EUC-JP and Shift_JIS. The following |
| 51 |
characteristics are as a result thereof. |
| 52 |
|
| 53 |
* JIS X plane 1 is (almost) a superset of JIS X 0208. However, with |
| 54 |
Unicode 3.2.0 the mappings differ in 3 codepoints. |
| 55 |
|
| 56 |
Kuten JIS X 0208 -> Unicode JIS X 0213 -> Unicode |
| 57 |
-------------------------------------------------------------- |
| 58 |
1-1-17 <UFFE3> # FULLWIDTH MACRON <U203E> # OVERLINE |
| 59 |
1-1-29 <U2014> # EM DASH <U2015> # HORIZONTAL BAR |
| 60 |
1-1-79 <UFFE5> # FULLWIDTH YEN SIGN <U00A5> # YEN SIGN |
| 61 |
|
| 62 |
* By the same token, JIS X 0213 plane 2 contains JIS Dai-4 Suijun Kanji |
| 63 |
(JIS Kanji Repertoire Level 4). This allows EUC-JP's G3 to contain |
| 64 |
both JIS X 0212 and JIS 0213 plane 2. |
| 65 |
|
| 66 |
However, JIS X 0212:1990 already contains many of Dai-4 Suijun Kanji |
| 67 |
so EUC's G3 is subject to containing duplicate mappings. |
| 68 |
|
| 69 |
* Because of Halfwidth Katakana, Shift_JIS mapping has been tricky and |
| 70 |
it is even trickier. Here is a regex that matches Shift_JISX0213 |
| 71 |
sequence (note: you have to "use bytes" to make it work!) |
| 72 |
|
| 73 |
$re_valid_shifjisx0213 = |
| 74 |
qr/^(?: |
| 75 |
[\x00-\x7f] | # ASCII or |
| 76 |
[\xa1-\xdf] | # JIS X 0201 KANA or |
| 77 |
[\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc] # JIS X 0213 |
| 78 |
)+$/xo; |
| 79 |
|
| 80 |
Note on EUC-JISX0213 (vs. EUC-JP) |
| 81 |
As of Encode-1.64, 'euc-jp' does support euc-jisx0213 for decoding. |
| 82 |
However, 'euc-jp' in Encode and 'euc-jisx0213' differ as follows; |
| 83 |
|
| 84 |
euc-jp euc-jisx0213 |
| 85 |
-------------------------------------------------------------- |
| 86 |
Decodes.... (0201-K|0208|0212|0213) ditto |
| 87 |
Round-Trip (|0) (020-K|0208|0212) JIS X (0201-K|0213) |
| 88 |
Decode Only (|3) those only found in 0213 |
| 89 |
those only found in 0212 |
| 90 |
-------------------------------------------------------------- |
| 91 |
|
| 92 |
AUTHORS |
| 93 |
Dan Kogai, "<dankogai+cpan at gmail.com>" |
| 94 |
|
| 95 |
COPYRIGHT |
| 96 |
Copyright 2002-2023 by Dan Kogai "<dankogai+cpan at gmail.com>". |
| 97 |
|
| 98 |
This program is free software; you can redistribute it and/or modify it |
| 99 |
under the same terms as Perl itself. |
| 100 |
|
| 101 |
See <http://www.perl.com/perl/misc/Artistic.html> |
| 102 |
|
| 103 |
SEE ALSO |
| 104 |
Encode, Encode::JP |
| 105 |
|
| 106 |
Japanese Graphic Character Set for Information Interchange -- Plane 1 |
| 107 |
<http://www.itscj.ipsj.or.jp/ISO-IR/228.pdf> |
| 108 |
|
| 109 |
Japanese Graphic Character Set for Information Interchange -- Plane 2 |
| 110 |
<http://www.itscj.ipsj.or.jp/ISO-IR/229.pdf> |
| 111 |
|