Debian Codegraph @

upstream/mageia-cauldron/man3pm/Encode::JP.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Encode::JP 3pm"
61 .TH Encode::JP 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Encode::JP \- Japanese Encodings
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 3
71 \& use Encode qw/encode decode/;
72 \& $euc_jp = encode("euc\-jp", $utf8); # loads Encode::JP implicitly
73 \& $utf8 = decode("euc\-jp", $euc_jp); # ditto
74 .Ve
75 .SH ABSTRACT
76 .IX Header "ABSTRACT"
77 This module implements Japanese charset encodings. Encodings
78 supported are as follows.
79 .PP
80 .Vb 10
81 \& Canonical Alias Description
82 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
83 \& euc\-jp /\ebeuc.*jp$/i EUC (Extended Unix Character)
84 \& /\ebjp.*euc/i
85 \& /\ebujis$/i
86 \& shiftjis /\ebshift.*jis$/i Shift JIS (aka MS Kanji)
87 \& /\ebsjis$/i
88 \& 7bit\-jis /\ebjis$/i 7bit JIS
89 \& iso\-2022\-jp ISO\-2022\-JP [RFC1468]
90 \& = 7bit JIS with all Halfwidth Kana
91 \& converted to Fullwidth
92 \& iso\-2022\-jp\-1 ISO\-2022\-JP\-1 [RFC2237]
93 \& = ISO\-2022\-JP with JIS X 0212\-1990
94 \& support. See below
95 \& MacJapanese Shift JIS + Apple vendor mappings
96 \& cp932 /\ebwindows\-31j$/i Code Page 932
97 \& = Shift JIS + MS/IBM vendor mappings
98 \& jis0201\-raw JIS0201, raw format
99 \& jis0208\-raw JIS0208, raw format
100 \& jis0212\-raw JIS0212, raw format
101 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
102 .Ve
103 .SH DESCRIPTION
104 .IX Header "DESCRIPTION"
105 To find out how to use this module in detail, see Encode.
106 .SH "Note on ISO\-2022\-JP(\-1)?"
107 .IX Header "Note on ISO-2022-JP(-1)?"
108 ISO\-2022\-JP\-1 (RFC2237) is a superset of ISO\-2022\-JP (RFC1468) which
109 adds support for JIS X 0212\-1990. That means you can use the same
110 code to decode to utf8 but not vice versa.
111 .PP
112 .Vb 1
113 \& $utf8 = decode(\*(Aqiso\-2022\-jp\-1\*(Aq, $stream);
114 .Ve
115 .PP
116 and
117 .PP
118 .Vb 1
119 \& $utf8 = decode(\*(Aqiso\-2022\-jp\*(Aq, $stream);
120 .Ve
121 .PP
122 yield the same result but
123 .PP
124 .Vb 1
125 \& $with_0212 = encode(\*(Aqiso\-2022\-jp\-1\*(Aq, $utf8);
126 .Ve
127 .PP
128 is now different from
129 .PP
130 .Vb 1
131 \& $without_0212 = encode(\*(Aqiso\-2022\-jp\*(Aq, $utf8 );
132 .Ve
133 .PP
134 In the latter case, characters that map to 0212 are first converted
135 to U+3013 (0xA2AE in EUC\-JP; a white square also known as \*(AqTofu\*(Aq or
136 \&\*(Aqgeta mark\*(Aq) then fed to the decoding engine. U+FFFD is not used,
137 in order to preserve text layout as much as possible.
138 .SH BUGS
139 .IX Header "BUGS"
140 The ASCII region (0x00\-0x7f) is preserved for all encodings, even
141 though this conflicts with mappings by the Unicode Consortium.
142 .SH "SEE ALSO"
143 .IX Header "SEE ALSO"
144 Encode