1Encode::ISO2022(3) User Contributed Perl Documentation Encode::ISO2022(3)
2
3
4
6 Encode::ISO2022 - ISO/IEC 2022 character encoding scheme
7
9 package FooEncoding;
10 use base qw(Encode::ISO2022);
11
12 __PACKAGE__->Define(
13 Name => 'foo-encoding',
14 CCS => [ {...CCS one...}, {...CCS two...}, ....]
15 );
16
18 This module provides a character encoding scheme (CES) switching a set
19 of multiple coded character sets (CCS).
20
21 A class method Define() may take following arguments.
22
23 Alias => REGEX
24 The regular expression representing alias of this encoding, if any.
25
26 Name => STRING
27 The name of this encoding as Encode::Encoding object. Mandatory.
28
29 CCS => [ FEATURE, FEATURE, ...]
30 List of features defining CCSs used by this encoding. Mandatory.
31 Each item is a hash reference containing following items.
32
33 bytes => NUMBER
34 Number of bytes to represent each character. Default is 1.
35
36 cl => BOOLEAN
37 If true value is set, this CCS includes map to/from code points
38 between 0/0 and 1/15. There should be one CCS with this flag
39 to reset broken designation.
40
41 dec_only => BOOLEAN
42 If true value is set, this CCS will be used only for decoding.
43
44 encoding => STRING | ENCODING
45 Encode::Encoding object used as CCS, or its name. Mandatory.
46
47 Encodings used for CCS must provide "raw" conversion. Namely,
48 they must be stateless and fixed-length conversion over 94^n or
49 96^n code tables. Encode::ISO2022::CCS lists available CCSs.
50
51 g => STRING
52 g_init => STRING
53 Working set this CCS may be designated to: 'g0', 'g1', 'g2' or
54 'g3'.
55
56 If "g_init" is set, this CCS will be designated at beginning of
57 coversion implicitly, and at end of conversion explicitly.
58
59 If "g" or "g_init" is set and neither of "ls" nor "ss" is set,
60 this CCS will be invoked when it is designated.
61
62 If neither of "g", "g_init", "ls" nor "ss" is set, this CCS is
63 invoked always.
64
65 g_seq => STRING
66 Escape sequence to designate this CCS, if it can be designated
67 explicitly.
68
69 gr => BOOLEAN
70 If true value is set, this CCS will be invoked to GR using
71 7-bit conversion table.
72
73 ls => STRING
74 ss => STRING
75 Escape sequence or control character to invoke this CCS, if it
76 should be invoked explicitly.
77
78 If "ls" is set, this CCS will be invoked by locking-shift. If
79 "ss" is set, this CCS will be invoked by single-shift.
80
81 range => STRING
82 Possible range of encoded bytes. General value is '\x21-\x7E',
83 '\x20-\x7F', '\xA1-\xFE' or '\xA0-\xFF'. This is required for
84 multibyte CCSs to detect broken multibyte sequences.
85
86 LineInit => BOOLEAN
87 If it is true, designation and invokation states will be
88 initialized at beginning of lines.
89
90 SubChar => STRING
91 Unicode string to be used for substitution character.
92
93 To know more about use of this module, the source of Encode::ISO2022JP2
94 may be an example.
95
97 This module implements small subset of the features defined by ISO/IEC
98 2022. Each encoding recognizes only several predefined designation and
99 invokation functions. It can handle limited number of coded character
100 sets. Variable length multibyte coded character sets aren't supported.
101 And so on.
102
104 ISO/IEC 2022 Information technology - Character code structure and
105 extension techniques.
106
107 Encode, Encode::ISO2022::CCS.
108
110 Hatuka*nezumi - IKEDA Soji, <nezumi@cpan.org>
111
113 Copyright (C) 2013 by Hatuka*nezumi - IKEDA Soji
114
115 This program is free software; you can redistribute it and/or modify it
116 under the same terms as Perl itself.
117
118
119
120perl v5.36.0 2022-07-22 Encode::ISO2022(3)