Debian Codegraph @

upstream/debian-unstable/man3/Encode::JP.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (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 .\"
57 .IX Title "Encode::JP 3perl"
58 .TH Encode::JP 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 Encode::JP \- Japanese Encodings
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 .Vb 3
68 \& use Encode qw/encode decode/;
69 \& $euc_jp = encode("euc\-jp", $utf8); # loads Encode::JP implicitly
70 \& $utf8 = decode("euc\-jp", $euc_jp); # ditto
71 .Ve
72 .SH ABSTRACT
73 .IX Header "ABSTRACT"
74 This module implements Japanese charset encodings. Encodings
75 supported are as follows.
76 .PP
77 .Vb 10
78 \& Canonical Alias Description
79 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
80 \& euc\-jp /\ebeuc.*jp$/i EUC (Extended Unix Character)
81 \& /\ebjp.*euc/i
82 \& /\ebujis$/i
83 \& shiftjis /\ebshift.*jis$/i Shift JIS (aka MS Kanji)
84 \& /\ebsjis$/i
85 \& 7bit\-jis /\ebjis$/i 7bit JIS
86 \& iso\-2022\-jp ISO\-2022\-JP [RFC1468]
87 \& = 7bit JIS with all Halfwidth Kana
88 \& converted to Fullwidth
89 \& iso\-2022\-jp\-1 ISO\-2022\-JP\-1 [RFC2237]
90 \& = ISO\-2022\-JP with JIS X 0212\-1990
91 \& support. See below
92 \& MacJapanese Shift JIS + Apple vendor mappings
93 \& cp932 /\ebwindows\-31j$/i Code Page 932
94 \& = Shift JIS + MS/IBM vendor mappings
95 \& jis0201\-raw JIS0201, raw format
96 \& jis0208\-raw JIS0208, raw format
97 \& jis0212\-raw JIS0212, raw format
98 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
99 .Ve
100 .SH DESCRIPTION
101 .IX Header "DESCRIPTION"
102 To find out how to use this module in detail, see Encode.
103 .SH "Note on ISO\-2022\-JP(\-1)?"
104 .IX Header "Note on ISO-2022-JP(-1)?"
105 ISO\-2022\-JP\-1 (RFC2237) is a superset of ISO\-2022\-JP (RFC1468) which
106 adds support for JIS X 0212\-1990. That means you can use the same
107 code to decode to utf8 but not vice versa.
108 .PP
109 .Vb 1
110 \& $utf8 = decode(\*(Aqiso\-2022\-jp\-1\*(Aq, $stream);
111 .Ve
112 .PP
113 and
114 .PP
115 .Vb 1
116 \& $utf8 = decode(\*(Aqiso\-2022\-jp\*(Aq, $stream);
117 .Ve
118 .PP
119 yield the same result but
120 .PP
121 .Vb 1
122 \& $with_0212 = encode(\*(Aqiso\-2022\-jp\-1\*(Aq, $utf8);
123 .Ve
124 .PP
125 is now different from
126 .PP
127 .Vb 1
128 \& $without_0212 = encode(\*(Aqiso\-2022\-jp\*(Aq, $utf8 );
129 .Ve
130 .PP
131 In the latter case, characters that map to 0212 are first converted
132 to U+3013 (0xA2AE in EUC-JP; a white square also known as 'Tofu' or
133 \&'geta mark') then fed to the decoding engine. U+FFFD is not used,
134 in order to preserve text layout as much as possible.
135 .SH BUGS
136 .IX Header "BUGS"
137 The ASCII region (0x00\-0x7f) is preserved for all encodings, even
138 though this conflicts with mappings by the Unicode Consortium.
139 .SH "SEE ALSO"
140 .IX Header "SEE ALSO"
141 Encode