Integrate mainline
[p5sagit/p5-mst-13.2.git] / ext / Encode / JP / JP.pm
CommitLineData
0e567a6c 1package Encode::JP;
0f3b375a 2BEGIN {
3 if (ord("A") == 193) {
4 die "Encode::JP not supported on EBCDIC\n";
5 }
6}
0e567a6c 7use Encode;
48e3bbdd 8our $VERSION = do { my @r = (q$Revision: 1.0 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
ee981de6 9
0e567a6c 10use XSLoader;
11XSLoader::load('Encode::JP',$VERSION);
12
13use Encode::JP::JIS;
64ffdd5e 14use Encode::JP::2022_JP;
15use Encode::JP::2022_JP1;
0e567a6c 16
171;
18__END__
48e3bbdd 19
557e5ea9 20=head1 NAME
21
22Encode::JP - Japanese Encodings
23
24=head1 SYNOPSIS
25
1b2c56c8 26 use Encode qw/encode decode/;
2b217bf7 27 $euc_jp = encode("euc-jp", $utf8); # loads Encode::JP implicitly
ee981de6 28 $utf8 = decode("euc-jp", $euc_jp); # ditto
557e5ea9 29
30=head1 ABSTRACT
31
32This module implements Japanese charset encodings. Encodings
33supported are as follows.
34
fab31126 35 Canonical Alias Description
36 --------------------------------------------------------------------
48e3bbdd 37 euc-jp /\beuc.*jp$/i EUC (Extended Unix Character)
38 /\bjp.*euc/i
39 /\bujis$/i
40 shiftjis /\bshift.*jis$/i Shift JIS (aka MS Kanji)
41 /\bsjis$/i
42 7bit-jis /\bjis$/i 7bit JIS
43 iso-2022-jp ISO-2022-JP [RFC1468]
fab31126 44 (7bit JIS with all Halfwidth Kana
45 converted to Fullwidth)
48e3bbdd 46 iso-2022-jp-1 ISO-2022-JP-1 [RFC2237]
a63c962f 47 (ISO-2022-JP with JIS X 0212-1990
48 support. See below)
48e3bbdd 49 MacJapanese (Shift JIS + Apple vendor mappings)
50 cp932 Code Page 932
51 (Shift JIS + MS/IBM vendor mappings)
5129552c 52 --------------------------------------------------------------------
557e5ea9 53
54=head1 DESCRIPTION
55
56To find how to use this module in detail, see L<Encode>.
57
a63c962f 58=head1 Note on ISO-2022-JP(-1)?
59
60ISO-2022-JP-1 (RFC2237) is a superset of ISO-2022-JP (RFC1468) which
61adds support for JIS X 0212-1990. That means you can use the same
62code to decode to utf8 but not vice versa.
63
64 $utf8 = decode('iso-2022-jp-1', $stream);
65 $utf8 = decode('iso-2022-jp', $stream);
66
67Yields the same result but
68
69 $with_0212 = encode('iso-2022-jp-1', $utf8);
70
71is now different from
72
73 $without_0212 = encode('iso-2022-jp', $utf8 );
74
75In the latter case, characters that map to 0212 are at first converted
76to U+3013 (0xA2AE in EUC-JP; a white square also known as 'Tofu') then
77fed to decoding engine. U+FFFD is not used to preserve text layout as
78much as possible.
79
557e5ea9 80=head1 BUGS
81
557e5ea9 82ASCII part (0x00-0x7f) is preserved for all encodings, even though it
83conflicts with mappings by the Unicode Consortium. See
84
a63c962f 85L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
557e5ea9 86
87to find why it is implemented that way.
88
89=head1 SEE ALSO
90
48e3bbdd 91L<Encode>,L<Encode::CJKguide>
557e5ea9 92
93=cut