New XS::APItest's for sv_peek based on my DDumper work
[p5sagit/p5-mst-13.2.git] / ext / Encode / JP / JP.pm
CommitLineData
0e567a6c 1package Encode::JP;
0f3b375a 2BEGIN {
d1256cb1 3 if ( ord("A") == 193 ) {
4 die "Encode::JP not supported on EBCDIC\n";
0f3b375a 5 }
6}
656ebd29 7use strict;
8use warnings;
0e567a6c 9use Encode;
656ebd29 10our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
ee981de6 11
0e567a6c 12use XSLoader;
d1256cb1 13XSLoader::load( __PACKAGE__, $VERSION );
0e567a6c 14
aae85ceb 15use Encode::JP::JIS7;
0e567a6c 16
171;
18__END__
67d7b5ef 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 --------------------------------------------------------------------
67d7b5ef 37 euc-jp /\beuc.*jp$/i EUC (Extended Unix Character)
38 /\bjp.*euc/i
d1256cb1 39 /\bujis$/i
67d7b5ef 40 shiftjis /\bshift.*jis$/i Shift JIS (aka MS Kanji)
d1256cb1 41 /\bsjis$/i
67d7b5ef 42 7bit-jis /\bjis$/i 7bit JIS
43 iso-2022-jp ISO-2022-JP [RFC1468]
d1256cb1 44 = 7bit JIS with all Halfwidth Kana
45 converted to Fullwidth
67d7b5ef 46 iso-2022-jp-1 ISO-2022-JP-1 [RFC2237]
a999c27c 47 = ISO-2022-JP with JIS X 0212-1990
d1256cb1 48 support. See below
a999c27c 49 MacJapanese Shift JIS + Apple vendor mappings
8f1ed24a 50 cp932 /\bwindows-31j$/i Code Page 932
a999c27c 51 = Shift JIS + MS/IBM vendor mappings
f2a2953c 52 jis0201-raw JIS0201, raw format
53 jis0208-raw JIS0201, raw format
54 jis0212-raw JIS0201, raw format
5129552c 55 --------------------------------------------------------------------
557e5ea9 56
57=head1 DESCRIPTION
58
0ab8f81e 59To find out how to use this module in detail, see L<Encode>.
557e5ea9 60
a63c962f 61=head1 Note on ISO-2022-JP(-1)?
62
63ISO-2022-JP-1 (RFC2237) is a superset of ISO-2022-JP (RFC1468) which
64adds support for JIS X 0212-1990. That means you can use the same
65code to decode to utf8 but not vice versa.
66
67 $utf8 = decode('iso-2022-jp-1', $stream);
0ab8f81e 68
69and
70
a63c962f 71 $utf8 = decode('iso-2022-jp', $stream);
72
0ab8f81e 73yield the same result but
a63c962f 74
75 $with_0212 = encode('iso-2022-jp-1', $utf8);
76
77is now different from
78
79 $without_0212 = encode('iso-2022-jp', $utf8 );
80
0ab8f81e 81In the latter case, characters that map to 0212 are first converted
82to U+3013 (0xA2AE in EUC-JP; a white square also known as 'Tofu' or
83'geta mark') then fed to the decoding engine. U+FFFD is not used,
84in order to preserve text layout as much as possible.
a63c962f 85
557e5ea9 86=head1 BUGS
87
0ab8f81e 88The ASCII region (0x00-0x7f) is preserved for all encodings, even
89though this conflicts with mappings by the Unicode Consortium. See
557e5ea9 90
a63c962f 91L<http://www.debian.or.jp/~kubota/unicode-symbols.html.en>
557e5ea9 92
0ab8f81e 93to find out why it is implemented that way.
557e5ea9 94
95=head1 SEE ALSO
96
85982a32 97L<Encode>
557e5ea9 98
99=cut