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