1Encode::JP(3pm) Perl Programmers Reference Guide Encode::JP(3pm)
2
3
4
6 Encode::JP - Japanese Encodings
7
9 use Encode qw/encode decode/;
10 $euc_jp = encode("euc-jp", $utf8); # loads Encode::JP implicitly
11 $utf8 = decode("euc-jp", $euc_jp); # ditto
12
14 This module implements Japanese charset encodings. Encodings supported
15 are as follows.
16
17 Canonical Alias Description
18 --------------------------------------------------------------------
19 euc-jp /\beuc.*jp$/i EUC (Extended Unix Character)
20 /\bjp.*euc/i
21 /\bujis$/i
22 shiftjis /\bshift.*jis$/i Shift JIS (aka MS Kanji)
23 /\bsjis$/i
24 7bit-jis /\bjis$/i 7bit JIS
25 iso-2022-jp ISO-2022-JP [RFC1468]
26 = 7bit JIS with all Halfwidth Kana
27 converted to Fullwidth
28 iso-2022-jp-1 ISO-2022-JP-1 [RFC2237]
29 = ISO-2022-JP with JIS X 0212-1990
30 support. See below
31 MacJapanese Shift JIS + Apple vendor mappings
32 cp932 /\bwindows-31j$/i Code Page 932
33 = Shift JIS + MS/IBM vendor mappings
34 jis0201-raw JIS0201, raw format
35 jis0208-raw JIS0201, raw format
36 jis0212-raw JIS0201, raw format
37 --------------------------------------------------------------------
38
40 To find out how to use this module in detail, see Encode.
41
43 ISO-2022-JP-1 (RFC2237) is a superset of ISO-2022-JP (RFC1468) which
44 adds support for JIS X 0212-1990. That means you can use the same code
45 to decode to utf8 but not vice versa.
46
47 $utf8 = decode('iso-2022-jp-1', $stream);
48
49 and
50
51 $utf8 = decode('iso-2022-jp', $stream);
52
53 yield the same result but
54
55 $with_0212 = encode('iso-2022-jp-1', $utf8);
56
57 is now different from
58
59 $without_0212 = encode('iso-2022-jp', $utf8 );
60
61 In the latter case, characters that map to 0212 are first converted to
62 U+3013 (0xA2AE in EUC-JP; a white square also known as 'Tofu' or 'geta
63 mark') then fed to the decoding engine. U+FFFD is not used, in order
64 to preserve text layout as much as possible.
65
67 The ASCII region (0x00-0x7f) is preserved for all encodings, even
68 though this conflicts with mappings by the Unicode Consortium. See
69
70 <http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
71
72 to find out why it is implemented that way.
73
75 Encode
76
77
78
79perl v5.8.8 2001-09-21 Encode::JP(3pm)