2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>perluniintro - Perl Unicode introduction
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> perluniintro - Perl Unicode introduction
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#description">DESCRIPTION
</a></li>
26 <li><a href=
"#unicode">Unicode
</a></li>
27 <li><a href=
"#perl_s_unicode_support">Perl's Unicode Support
</a></li>
28 <li><a href=
"#perl_s_unicode_model">Perl's Unicode Model
</a></li>
29 <li><a href=
"#unicode_and_ebcdic">Unicode and EBCDIC
</a></li>
30 <li><a href=
"#creating_unicode">Creating Unicode
</a></li>
31 <li><a href=
"#handling_unicode">Handling Unicode
</a></li>
32 <li><a href=
"#legacy_encodings">Legacy Encodings
</a></li>
33 <li><a href=
"#unicode_i_o">Unicode I/O
</a></li>
34 <li><a href=
"#displaying_unicode_as_text">Displaying Unicode As Text
</a></li>
35 <li><a href=
"#special_cases">Special Cases
</a></li>
36 <li><a href=
"#advanced_topics">Advanced Topics
</a></li>
37 <li><a href=
"#miscellaneous">Miscellaneous
</a></li>
38 <li><a href=
"#questions_with_answers">Questions With Answers
</a></li>
39 <li><a href=
"#hexadecimal_notation">Hexadecimal Notation
</a></li>
40 <li><a href=
"#further_resources">Further Resources
</a></li>
43 <li><a href=
"#unicode_in_older_perls">UNICODE IN OLDER PERLS
</a></li>
44 <li><a href=
"#see_also">SEE ALSO
</a></li>
45 <li><a href=
"#acknowledgments">ACKNOWLEDGMENTS
</a></li>
46 <li><a href=
"#author__copyright__and_license">AUTHOR, COPYRIGHT, AND LICENSE
</a></li>
53 <h1><a name=
"name">NAME
</a></h1>
54 <p>perluniintro - Perl Unicode introduction
</p>
58 <h1><a name=
"description">DESCRIPTION
</a></h1>
59 <p>This document gives a general idea of Unicode and how to use Unicode
63 <h2><a name=
"unicode">Unicode
</a></h2>
64 <p>Unicode is a character set standard which plans to codify all of the
65 writing systems of the world, plus many other symbols.
</p>
66 <p>Unicode and ISO/IEC
10646 are coordinated standards that provide code
67 points for characters in almost all modern character set standards,
68 covering more than
30 writing systems and hundreds of languages,
69 including all commercially-important modern languages. All characters
70 in the largest Chinese, Japanese, and Korean dictionaries are also
71 encoded. The standards will eventually cover almost all characters in
72 more than
250 writing systems and thousands of languages.
73 Unicode
1.0 was released in October
1991, and
4.0 in April
2003.
</p>
74 <p>A Unicode
<em>character
</em> is an abstract entity. It is not bound to any
75 particular integer width, especially not to the C language
<code>char
</code>.
76 Unicode is language-neutral and display-neutral: it does not encode the
77 language of the text and it does not define fonts or other graphical
78 layout details. Unicode operates on characters and on text built from
80 <p>Unicode defines characters like
<code>LATIN CAPITAL LETTER A
</code> or
<code>GREEK
81 SMALL LETTER ALPHA
</code> and unique numbers for the characters, in this
82 case
0x0041 and
0x03B1, respectively. These unique numbers are called
83 <em>code points
</em>.
</p>
84 <p>The Unicode standard prefers using hexadecimal notation for the code
85 points. If numbers like
<code>0x0041</code> are unfamiliar to you, take a peek
86 at a later section,
<a href=
"#hexadecimal_notation">Hexadecimal Notation
</a>. The Unicode standard
87 uses the notation
<code>U+
0041 LATIN CAPITAL LETTER A
</code>, to give the
88 hexadecimal code point and the normative name of the character.
</p>
89 <p>Unicode also defines various
<em>properties
</em> for the characters, like
90 ``uppercase'' or ``lowercase'', ``decimal digit'', or ``punctuation'';
91 these properties are independent of the names of the characters.
92 Furthermore, various operations on the characters like uppercasing,
93 lowercasing, and collating (sorting) are defined.
</p>
94 <p>A Unicode character consists either of a single code point, or a
95 <em>base character
</em> (like
<code>LATIN CAPITAL LETTER A
</code>), followed by one or
96 more
<em>modifiers
</em> (like
<code>COMBINING ACUTE ACCENT
</code>). This sequence of
97 base character and modifiers is called a
<em>combining character
99 <p>Whether to call these combining character sequences ``characters''
100 depends on your point of view. If you are a programmer, you probably
101 would tend towards seeing each element in the sequences as one unit,
102 or ``character''. The whole sequence could be seen as one ``character'',
103 however, from the user's point of view, since that's probably what it
104 looks like in the context of the user's language.
</p>
105 <p>With this ``whole sequence'' view of characters, the total number of
106 characters is open-ended. But in the programmer's ``one unit is one
107 character'' point of view, the concept of ``characters'' is more
108 deterministic. In this document, we take that second point of view:
109 one ``character'' is one Unicode code point, be it a base character or
110 a combining character.
</p>
111 <p>For some combinations, there are
<em>precomposed
</em> characters.
112 <code>LATIN CAPITAL LETTER A WITH ACUTE
</code>, for example, is defined as
113 a single code point. These precomposed characters are, however,
114 only available for some combinations, and are mainly
115 meant to support round-trip conversions between Unicode and legacy
116 standards (like the ISO
8859). In the general case, the composing
117 method is more extensible. To support conversion between
118 different compositions of the characters, various
<em>normalization
119 forms
</em> to standardize representations are also defined.
</p>
120 <p>Because of backward compatibility with legacy encodings, the ``a unique
121 number for every character'' idea breaks down a bit: instead, there is
122 ``at least one number for every character''. The same character could
123 be represented differently in several legacy encodings. The
124 converse is also not true: some code points do not have an assigned
125 character. Firstly, there are unallocated code points within
126 otherwise used blocks. Secondly, there are special Unicode control
127 characters that do not represent true characters.
</p>
128 <p>A common myth about Unicode is that it would be ``
16-bit'', that is,
129 Unicode is only represented as
<code>0x10000</code> (or
65536) characters from
130 <code>0x0000</code> to
<code>0xFFFF</code>.
<strong>This is untrue.
</strong> Since Unicode
2.0 (July
131 1996), Unicode has been defined all the way up to
21 bits (
<code>0x10FFFF</code>),
132 and since Unicode
3.1 (March
2001), characters have been defined
133 beyond
<code>0xFFFF</code>. The first
<code>0x10000</code> characters are called the
134 <em>Plane
0</em>, or the
<em>Basic Multilingual Plane
</em> (BMP). With Unicode
135 3.1,
17 (yes, seventeen) planes in all were defined--but they are
136 nowhere near full of defined characters, yet.
</p>
137 <p>Another myth is that the
256-character blocks have something to
138 do with languages--that each block would define the characters used
139 by a language or a set of languages.
<strong>This is also untrue.
</strong>
140 The division into blocks exists, but it is almost completely
141 accidental--an artifact of how the characters have been and
142 still are allocated. Instead, there is a concept called
<em>scripts
</em>,
143 which is more useful: there is
<code>Latin
</code> script,
<code>Greek
</code> script, and
144 so on. Scripts usually span varied parts of several blocks.
145 For further information see
<a href=
"file://C|\msysgit\mingw\html/lib/Unicode/UCD.html">the Unicode::UCD manpage
</a>.
</p>
146 <p>The Unicode code points are just abstract numbers. To input and
147 output these abstract numbers, the numbers must be
<em>encoded
</em> or
148 <em>serialised
</em> somehow. Unicode defines several
<em>character encoding
149 forms
</em>, of which
<em>UTF-
8</em> is perhaps the most popular. UTF-
8 is a
150 variable length encoding that encodes Unicode characters as
1 to
6
151 bytes (only
4 with the currently defined characters). Other encodings
152 include UTF-
16 and UTF-
32 and their big- and little-endian variants
153 (UTF-
8 is byte-order independent) The ISO/IEC
10646 defines the UCS-
2
154 and UCS-
4 encoding forms.
</p>
155 <p>For more information about encodings--for instance, to learn what
156 <em>surrogates
</em> and
<em>byte order marks
</em> (BOMs) are--see
<a href=
"file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage
</a>.
</p>
159 <h2><a name=
"perl_s_unicode_support">Perl's Unicode Support
</a></h2>
160 <p>Starting from Perl
5.6.0, Perl has had the capacity to handle Unicode
161 natively. Perl
5.8.0, however, is the first recommended release for
162 serious Unicode work. The maintenance release
5.6.1 fixed many of the
163 problems of the initial Unicode implementation, but for example
164 regular expressions still do not work with Unicode in
5.6.1.
</p>
165 <p><strong>Starting from Perl
5.8.0, the use of
<code>use utf8
</code> is no longer
166 necessary.
</strong> In earlier releases the
<code>utf8
</code> pragma was used to declare
167 that operations in the current block or file would be Unicode-aware.
168 This model was found to be wrong, or at least clumsy: the ``Unicodeness''
169 is now carried with the data, instead of being attached to the
170 operations. Only one case remains where an explicit
<code>use utf8
</code> is
171 needed: if your Perl script itself is encoded in UTF-
8, you can use
172 UTF-
8 in your identifier names, and in string and regular expression
173 literals, by saying
<code>use utf8
</code>. This is not the default because
174 scripts with legacy
8-bit data in them would break. See
<a href=
"file://C|\msysgit\mingw\html/lib/utf8.html">the utf8 manpage
</a>.
</p>
177 <h2><a name=
"perl_s_unicode_model">Perl's Unicode Model
</a></h2>
178 <p>Perl supports both pre-
5.6 strings of eight-bit native bytes, and
179 strings of Unicode characters. The principle is that Perl tries to
180 keep its data as eight-bit bytes for as long as possible, but as soon
181 as Unicodeness cannot be avoided, the data is transparently upgraded
183 <p>Internally, Perl currently uses either whatever the native eight-bit
184 character set of the platform (for example Latin-
1) is, defaulting to
185 UTF-
8, to encode Unicode strings. Specifically, if all code points in
186 the string are
<code>0xFF</code> or less, Perl uses the native eight-bit
187 character set. Otherwise, it uses UTF-
8.
</p>
188 <p>A user of Perl does not normally need to know nor care how Perl
189 happens to encode its internal strings, but it becomes relevant when
190 outputting Unicode strings to a stream without a PerlIO layer -- one with
191 the ``default'' encoding. In such a case, the raw bytes used internally
192 (the native character set or UTF-
8, as appropriate for each string)
193 will be used, and a ``Wide character'' warning will be issued if those
194 strings contain a character beyond
0x00FF.
</p>
197 perl -e 'print
"\x{DF}\n
",
"\x{
0100}\x{DF}\n
"'
</pre>
198 <p>produces a fairly useless mixture of native bytes and UTF-
8, as well
201 Wide character in print at ...
</pre>
202 <p>To output UTF-
8, use the
<code>:utf8
</code> output layer. Prepending
</p>
204 binmode(STDOUT,
":utf8
");
</pre>
205 <p>to this sample program ensures that the output is completely UTF-
8,
206 and removes the program's warning.
</p>
207 <p>You can enable automatic UTF-
8-ification of your standard file
208 handles, default
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a> layer, and
<a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item__argv"><code>@ARGV
</code></a> by using either
209 the
<code>-C
</code> command line switch or the
<code>PERL_UNICODE
</code> environment
210 variable, see
<a href=
"file://C|\msysgit\mingw\html/pod/perlrun.html">the perlrun manpage
</a> for the documentation of the
<code>-C
</code> switch.
</p>
211 <p>Note that this means that Perl expects other software to work, too:
212 if Perl has been led to believe that STDIN should be UTF-
8, but then
213 STDIN coming in from another command is not UTF-
8, Perl will complain
214 about the malformed UTF-
8.
</p>
215 <p>All features that combine Unicode and I/O also require using the new
216 PerlIO feature. Almost all Perl
5.8 platforms do use PerlIO, though:
217 you can see whether yours is by running ``perl -V'' and looking for
218 <code>useperlio=define
</code>.
</p>
221 <h2><a name=
"unicode_and_ebcdic">Unicode and EBCDIC
</a></h2>
222 <p>Perl
5.8.0 also supports Unicode on EBCDIC platforms. There,
223 Unicode support is somewhat more complex to implement since
224 additional conversions are needed at every step. Some problems
225 remain, see
<a href=
"file://C|\msysgit\mingw\html/pod/perlebcdic.html">the perlebcdic manpage
</a> for details.
</p>
226 <p>In any case, the Unicode support on EBCDIC platforms is better than
227 in the
5.6 series, which didn't work much at all for EBCDIC platform.
228 On EBCDIC platforms, the internal Unicode encoding form is UTF-EBCDIC
229 instead of UTF-
8. The difference is that as UTF-
8 is ``ASCII-safe'' in
230 that ASCII characters encode to UTF-
8 as-is, while UTF-EBCDIC is
234 <h2><a name=
"creating_unicode">Creating Unicode
</a></h2>
235 <p>To create Unicode characters in literals for code points above
<code>0xFF</code>,
236 use the
<code>\x{...}
</code> notation in double-quoted strings:
</p>
238 my $smiley =
"\x{
263a}
";
</pre>
239 <p>Similarly, it can be used in regular expression literals
</p>
241 $smiley =~ /\x{
263a}/;
</pre>
242 <p>At run-time you can use
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr()
</code></a>:
</p>
244 my $hebrew_alef = chr(
0x05d0);
</pre>
245 <p>See
<a href=
"#further_resources">Further Resources
</a> for how to find all these numeric codes.
</p>
246 <p>Naturally,
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_ord"><code>ord()
</code></a> will do the reverse: it turns a character into
248 <p>Note that
<code>\x..
</code> (no
<code>{}
</code> and only two hexadecimal digits),
<code>\x{...}
</code>,
249 and
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr(...)
</code></a> for arguments less than
<code>0x100</code> (decimal
256)
250 generate an eight-bit character for backward compatibility with older
251 Perls. For arguments of
<code>0x100</code> or more, Unicode characters are
252 always produced. If you want to force the production of Unicode
253 characters regardless of the numeric value, use
<code>pack(
"U
", ...)
</code>
254 instead of
<code>\x..
</code>,
<code>\x{...}
</code>, or
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr()
</code></a>.
</p>
255 <p>You can also use the
<code>charnames
</code> pragma to invoke characters
256 by name in double-quoted strings:
</p>
258 use charnames ':full';
259 my $arabic_alef =
"\N{ARABIC LETTER ALEF}
";
</pre>
260 <p>And, as mentioned above, you can also
<code>pack()
</code> numbers into Unicode
263 my $georgian_an = pack(
"U
",
0x10a0);
</pre>
264 <p>Note that both
<code>\x{...}
</code> and
<code>\N{...}
</code> are compile-time string
265 constants: you cannot use variables in them. if you want similar
266 run-time functionality, use
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr()
</code></a> and
<code>charnames::vianame()
</code>.
</p>
267 <p>If you want to force the result to Unicode characters, use the special
268 <code>"U0
"</code> prefix. It consumes no arguments but forces the result to be
269 in Unicode characters, instead of bytes.
</p>
271 my $chars = pack(
"U0C*
",
0x80,
0x42);
</pre>
272 <p>Likewise, you can force the result to be bytes by using the special
273 <code>"C0
"</code> prefix.
</p>
276 <h2><a name=
"handling_unicode">Handling Unicode
</a></h2>
277 <p>Handling Unicode is for the most part transparent: just use the
278 strings as usual. Functions like
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_index"><code>index()
</code></a>,
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_length"><code>length()
</code></a>, and
279 <a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item_substr"><code>substr()
</code></a> will work on the Unicode characters; regular expressions
280 will work on the Unicode characters (see
<a href=
"file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage
</a> and
<a href=
"file://C|\msysgit\mingw\html/pod/perlretut.html">the perlretut manpage
</a>).
</p>
281 <p>Note that Perl considers combining character sequences to be
282 separate characters, so for example
</p>
284 use charnames ':full';
285 print length(
"\N{LATIN CAPITAL LETTER A}\N{COMBINING ACUTE ACCENT}
"),
"\n
";
</pre>
286 <p>will print
2, not
1. The only exception is that regular expressions
287 have
<code>\X
</code> for matching a combining character sequence.
</p>
288 <p>Life is not quite so transparent, however, when working with legacy
289 encodings, I/O, and certain special cases:
</p>
292 <h2><a name=
"legacy_encodings">Legacy Encodings
</a></h2>
293 <p>When you combine legacy data and Unicode the legacy data needs
294 to be upgraded to Unicode. Normally ISO
8859-
1 (or EBCDIC, if
295 applicable) is assumed. You can override this assumption by
296 using the
<code>encoding
</code> pragma, for example
</p>
298 use encoding 'latin2'; # ISO
8859-
2</pre>
299 <p>in which case literals (string or regular expressions),
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr()
</code></a>,
300 and
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_ord"><code>ord()
</code></a> in your whole script are assumed to produce Unicode
301 characters from ISO
8859-
2 code points. Note that the matching for
302 encoding names is forgiving: instead of
<code>latin2
</code> you could have
303 said
<code>Latin
2</code>, or
<code>iso8859-
2</code>, or other variations. With just
</p>
306 <p>the environment variable
<code>PERL_ENCODING
</code> will be consulted.
307 If that variable isn't set, the encoding pragma will fail.
</p>
308 <p>The
<code>Encode
</code> module knows about many encodings and has interfaces
309 for doing conversions between those encodings:
</p>
312 $data = decode(
"iso-
8859-
3", $data); # convert from legacy to utf-
8</pre>
315 <h2><a name=
"unicode_i_o">Unicode I/O
</a></h2>
316 <p>Normally, writing out Unicode data
</p>
318 print FH $some_string_with_unicode,
"\n
";
</pre>
319 <p>produces raw bytes that Perl happens to use to internally encode the
320 Unicode string. Perl's internal encoding depends on the system as
321 well as what characters happen to be in the string at the time. If
322 any of the characters are at code points
<code>0x100</code> or above, you will get
323 a warning. To ensure that the output is explicitly rendered in the
324 encoding you desire--and to avoid the warning--open the stream with
325 the desired encoding. Some examples:
</p>
327 open FH,
">:utf8
",
"file
";
</pre>
329 open FH,
">:encoding(ucs2)
",
"file
";
330 open FH,
">:encoding(UTF-
8)
",
"file
";
331 open FH,
">:encoding(shift_jis)
",
"file
";
</pre>
332 <p>and on already open streams, use
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode"><code>binmode()
</code></a>:
</p>
334 binmode(STDOUT,
":utf8
");
</pre>
336 binmode(STDOUT,
":encoding(ucs2)
");
337 binmode(STDOUT,
":encoding(UTF-
8)
");
338 binmode(STDOUT,
":encoding(shift_jis)
");
</pre>
339 <p>The matching of encoding names is loose: case does not matter, and
340 many encodings have several aliases. Note that the
<code>:utf8
</code> layer
341 must always be specified exactly like that; it is
<em>not
</em> subject to
342 the loose matching of encoding names.
</p>
343 <p>See
<a href=
"file://C|\msysgit\mingw\html/lib/Encode/PerlIO.html">the PerlIO manpage
</a> for the
<code>:utf8
</code> layer,
<a href=
"file://C|\msysgit\mingw\html/lib/PerlIO/encoding.html">the PerlIO::encoding manpage
</a> and
344 <a href=
"file://C|\msysgit\mingw\html/lib/Encode/PerlIO.html">the Encode::PerlIO manpage
</a> for the
<code>:encoding()
</code> layer, and
345 <a href=
"file://C|\msysgit\mingw\html/lib/Encode/Supported.html">the Encode::Supported manpage
</a> for many encodings supported by the
<code>Encode
</code>
347 <p>Reading in a file that you know happens to be encoded in one of the
348 Unicode or legacy encodings does not magically turn the data into
349 Unicode in Perl's eyes. To do that, specify the appropriate
350 layer when opening files
</p>
352 open(my $fh,'
<:utf8', 'anything');
353 my $line_of_unicode =
<$fh
>;
</pre>
355 open(my $fh,'
<:encoding(Big5)', 'anything');
356 my $line_of_unicode =
<$fh
>;
</pre>
357 <p>The I/O layers can also be specified more flexibly with
358 the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open
</code></a> pragma. See
<a href=
"file://C|\msysgit\mingw\html/lib/open.html">the open manpage
</a>, or look at the following example.
</p>
360 use open ':utf8'; # input and output default layer will be UTF-
8
361 open X,
">file
";
362 print X chr(
0x100),
"\n
";
364 open Y,
"<file
";
365 printf
"%#x\n
", ord(
<Y
>); # this should print
0x100
367 <p>With the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open
</code></a> pragma you can use the
<code>:locale
</code> layer
</p>
369 BEGIN { $ENV{LC_ALL} = $ENV{LANG} = 'ru_RU.KOI8-R' }
370 # the :locale will probe the locale environment variables like LC_ALL
371 use open OUT =
> ':locale'; # russki parusski
372 open(O,
">koi8
");
373 print O chr(
0x430); # Unicode CYRILLIC SMALL LETTER A = KOI8-R
0xc1
375 open(I,
"<koi8
");
376 printf
"%#x\n
", ord(
<I
>),
"\n
"; # this should print
0xc1
378 <p>or you can also use the
<code>':encoding(...)'
</code> layer
</p>
380 open(my $epic,'
<:encoding(iso-
8859-
7)','iliad.greek');
381 my $line_of_unicode =
<$epic
>;
</pre>
382 <p>These methods install a transparent filter on the I/O stream that
383 converts data from the specified encoding when it is read in from the
384 stream. The result is always Unicode.
</p>
385 <p>The
<a href=
"file://C|\msysgit\mingw\html/lib/open.html">the open manpage
</a> pragma affects all the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a> calls after the pragma by
386 setting default layers. If you want to affect only certain
387 streams, use explicit layers directly in the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a> call.
</p>
388 <p>You can switch encodings on an already opened stream by using
389 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode"><code>binmode()
</code></a>; see
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode">binmode in the perlfunc manpage
</a>.
</p>
390 <p>The
<code>:locale
</code> does not currently (as of Perl
5.8.0) work with
391 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a> and
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode"><code>binmode()
</code></a>, only with the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open
</code></a> pragma. The
392 <code>:utf8
</code> and
<code>:encoding(...)
</code> methods do work with all of
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a>,
393 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode"><code>binmode()
</code></a>, and the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open
</code></a> pragma.
</p>
394 <p>Similarly, you may use these I/O layers on output streams to
395 automatically convert Unicode to the specified encoding when it is
396 written to the stream. For example, the following snippet copies the
397 contents of the file ``text.jis'' (encoded as ISO-
2022-JP, aka JIS) to
398 the file ``text.utf8'', encoded as UTF-
8:
</p>
400 open(my $nihongo, '
<:encoding(iso-
2022-jp)', 'text.jis');
401 open(my $unicode, '
>:utf8', 'text.utf8');
402 while (
<$nihongo
>) { print $unicode $_ }
</pre>
403 <p>The naming of encodings, both by the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()
</code></a> and by the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open
</code></a>
404 pragma, is similar to the
<code>encoding
</code> pragma in that it allows for
405 flexible names:
<code>koi8-r
</code> and
<code>KOI8R
</code> will both be understood.
</p>
406 <p>Common encodings recognized by ISO, MIME, IANA, and various other
407 standardisation organisations are recognised; for a more detailed
408 list see
<a href=
"file://C|\msysgit\mingw\html/lib/Encode/Supported.html">the Encode::Supported manpage
</a>.
</p>
409 <p><a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_read"><code>read()
</code></a> reads characters and returns the number of characters.
410 <code>seek()
</code> and
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell()
</code></a> operate on byte counts, as do
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_sysread"><code>sysread()
</code></a>
411 and
<code>sysseek()
</code>.
</p>
412 <p>Notice that because of the default behaviour of not doing any
413 conversion upon input if there is no default layer,
414 it is easy to mistakenly write code that keeps on expanding a file
415 by repeatedly encoding the data:
</p>
418 open F,
"file
";
419 local $/; ## read in the whole file of
8-bit characters
422 open F,
">:utf8
",
"file
";
423 print F $t; ## convert to UTF-
8 on output
425 <p>If you run this code twice, the contents of the
<em>file
</em> will be twice
426 UTF-
8 encoded. A
<code>use open ':utf8'
</code> would have avoided the bug, or
427 explicitly opening also the
<em>file
</em> for input as UTF-
8.
</p>
428 <p><strong>NOTE
</strong>: the
<code>:utf8
</code> and
<code>:encoding
</code> features work only if your
429 Perl has been built with the new PerlIO feature (which is the default
430 on most systems).
</p>
433 <h2><a name=
"displaying_unicode_as_text">Displaying Unicode As Text
</a></h2>
434 <p>Sometimes you might want to display Perl scalars containing Unicode as
435 simple ASCII (or EBCDIC) text. The following subroutine converts
436 its argument so that Unicode characters with code points greater than
437 255 are displayed as
<code>\x{...}
</code>, control characters (like
<code>\n
</code>) are
438 displayed as
<code>\x..
</code>, and the rest of the characters as themselves:
</p>
442 map { $_
> 255 ? # if wide character...
443 sprintf(
"\\x{%
04X}
", $_) : # \x{...}
444 chr($_) =~ /[[:cntrl:]]/ ? # else if control character ...
445 sprintf(
"\\x%
02X
", $_) : # \x..
446 quotemeta(chr($_)) # else quoted or as themselves
447 } unpack(
"U*
", $_[
0])); # unpack Unicode characters
451 nice_string(
"foo\x{
100}bar\n
")
</pre>
452 <p>returns the string
</p>
454 'foo\x{
0100}bar\x0A'
</pre>
455 <p>which is ready to be printed.
</p>
458 <h2><a name=
"special_cases">Special Cases
</a></h2>
461 <p>Bit Complement Operator ~ And
<code>vec()
</code></p>
462 <p>The bit complement operator
<code>~
</code> may produce surprising results if
463 used on strings containing characters with ordinal values above
464 255. In such a case, the results are consistent with the internal
465 encoding of the characters, but not with much else. So don't do
466 that. Similarly for
<code>vec()
</code>: you will be operating on the
467 internally-encoded bit patterns of the Unicode characters, not on
468 the code point values, which is very probably not what you want.
</p>
471 <p>Peeking At Perl's Internal Encoding
</p>
472 <p>Normal users of Perl should never care how Perl encodes any particular
473 Unicode string (because the normal ways to get at the contents of a
474 string with Unicode--via input and output--should always be via
475 explicitly-defined I/O layers). But if you must, there are two
476 ways of looking behind the scenes.
</p>
477 <p>One way of peeking inside the internal encoding of Unicode characters
478 is to use
<code>unpack(
"C*
", ...
</code> to get the bytes or
<code>unpack(
"H*
", ...)
</code>
479 to display the bytes:
</p>
481 # this prints c4
80 for the UTF-
8 bytes
0xc4 0x80
482 print join(
" ", unpack(
"H*
", pack(
"U
",
0x100))),
"\n
";
</pre>
483 <p>Yet another way would be to use the Devel::Peek module:
</p>
485 perl -MDevel::Peek -e 'Dump(chr(
0x100))'
</pre>
486 <p>That shows the
<code>UTF8
</code> flag in FLAGS and both the UTF-
8 bytes
487 and Unicode characters in
<code>PV
</code>. See also later in this document
488 the discussion about the
<code>utf8::is_utf8()
</code> function.
</p>
493 <h2><a name=
"advanced_topics">Advanced Topics
</a></h2>
496 <p>String Equivalence
</p>
497 <p>The question of string equivalence turns somewhat complicated
498 in Unicode: what do you mean by ``equal''?
</p>
499 <p>(Is
<code>LATIN CAPITAL LETTER A WITH ACUTE
</code> equal to
500 <code>LATIN CAPITAL LETTER A
</code>?)
</p>
501 <p>The short answer is that by default Perl compares equivalence (
<code>eq
</code>,
502 <code>ne
</code>) based only on code points of the characters. In the above
503 case, the answer is no (because
0x00C1 !=
0x0041). But sometimes, any
504 CAPITAL LETTER As should be considered equal, or even As of any case.
</p>
505 <p>The long answer is that you need to consider character normalization
506 and casing issues: see
<a href=
"file://C|\msysgit\mingw\html/lib/Unicode/Normalize.html">the Unicode::Normalize manpage
</a>, Unicode Technical
507 Reports #
15 and #
21,
<em>Unicode Normalization Forms
</em> and
<em>Case
508 Mappings
</em>,
<a href=
"http://www.unicode.org/unicode/reports/tr15/">http://www.unicode.org/unicode/reports/tr15/
</a> and
509 <a href=
"http://www.unicode.org/unicode/reports/tr21/">http://www.unicode.org/unicode/reports/tr21/
</a></p>
510 <p>As of Perl
5.8.0, the ``Full'' case-folding of
<em>Case
511 Mappings/SpecialCasing
</em> is implemented.
</p>
514 <p>String Collation
</p>
515 <p>People like to see their strings nicely sorted--or as Unicode
516 parlance goes, collated. But again, what do you mean by collate?
</p>
517 <p>(Does
<code>LATIN CAPITAL LETTER A WITH ACUTE
</code> come before or after
518 <code>LATIN CAPITAL LETTER A WITH GRAVE
</code>?)
</p>
519 <p>The short answer is that by default, Perl compares strings (
<code>lt
</code>,
520 <code>le
</code>,
<code>cmp
</code>,
<code>ge
</code>,
<code>gt
</code>) based only on the code points of the
521 characters. In the above case, the answer is ``after'', since
522 <code>0x00C1</code> > <code>0x00C0</code>.
</p>
523 <p>The long answer is that ``it depends'', and a good answer cannot be
524 given without knowing (at the very least) the language context.
525 See
<a href=
"file://C|\msysgit\mingw\html/lib/Unicode/Collate.html">the Unicode::Collate manpage
</a>, and
<em>Unicode Collation Algorithm
</em>
526 <a href=
"http://www.unicode.org/unicode/reports/tr10/">http://www.unicode.org/unicode/reports/tr10/
</a></p>
531 <h2><a name=
"miscellaneous">Miscellaneous
</a></h2>
534 <p>Character Ranges and Classes
</p>
535 <p>Character ranges in regular expression character classes (
<code>/[a-z]/
</code>)
536 and in the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tr_"><code>tr///
</code></a> (also known as
<a href=
"file://C|\msysgit\mingw\html/pod/perlop.html#item_y_"><code>y///
</code></a>) operator are not magically
537 Unicode-aware. What this means that
<code>[A-Za-z]
</code> will not magically start
538 to mean ``all alphabetic letters''; not that it does mean that even for
539 8-bit characters, you should be using
<code>/[[:alpha:]]/
</code> in that case.
</p>
540 <p>For specifying character classes like that in regular expressions,
541 you can use the various Unicode properties--
<code>\pL
</code>, or perhaps
542 <code>\p{Alphabetic}
</code>, in this particular case. You can use Unicode
543 code points as the end points of character ranges, but there is no
544 magic associated with specifying a certain range. For further
545 information--there are dozens of Unicode character classes--see
546 <a href=
"file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage
</a>.
</p>
549 <p>String-To-Number Conversions
</p>
550 <p>Unicode does define several other decimal--and numeric--characters
551 besides the familiar
0 to
9, such as the Arabic and Indic digits.
552 Perl does not support string-to-number conversion for digits other
553 than ASCII
0 to
9 (and ASCII a to f for hexadecimal).
</p>
558 <h2><a name=
"questions_with_answers">Questions With Answers
</a></h2>
561 <p>Will My Old Scripts Break?
</p>
562 <p>Very probably not. Unless you are generating Unicode characters
563 somehow, old behaviour should be preserved. About the only behaviour
564 that has changed and which could start generating Unicode is the old
565 behaviour of
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr()
</code></a> where supplying an argument more than
255
566 produced a character modulo
255.
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr(
300)
</code></a>, for example, was equal
567 to
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr(
45)
</code></a> or ``-'' (in ASCII), now it is LATIN CAPITAL LETTER I WITH
571 <p>How Do I Make My Scripts Work With Unicode?
</p>
572 <p>Very little work should be needed since nothing changes until you
573 generate Unicode data. The most important thing is getting input as
574 Unicode; for that, see the earlier I/O discussion.
</p>
577 <p>How Do I Know Whether My String Is In Unicode?
</p>
578 <p>You shouldn't care. No, you really shouldn't. No, really. If you
579 have to care--beyond the cases described above--it means that we
580 didn't get the transparency of Unicode quite right.
</p>
581 <p>Okay, if you insist:
</p>
583 print utf8::is_utf8($string) ?
1 :
0,
"\n
";
</pre>
584 <p>But note that this doesn't mean that any of the characters in the
585 string are necessary UTF-
8 encoded, or that any of the characters have
586 code points greater than
0xFF (
255) or even
0x80 (
128), or that the
587 string has any characters at all. All the
<code>is_utf8()
</code> does is to
588 return the value of the internal ``utf8ness'' flag attached to the
589 <code>$string
</code>. If the flag is off, the bytes in the scalar are interpreted
590 as a single byte encoding. If the flag is on, the bytes in the scalar
591 are interpreted as the (multi-byte, variable-length) UTF-
8 encoded code
592 points of the characters. Bytes added to an UTF-
8 encoded string are
593 automatically upgraded to UTF-
8. If mixed non-UTF-
8 and UTF-
8 scalars
594 are merged (double-quoted interpolation, explicit concatenation, and
595 printf/sprintf parameter substitution), the result will be UTF-
8 encoded
596 as if copies of the byte strings were upgraded to UTF-
8: for example,
</p>
598 $a =
"ab\x80c
";
599 $b =
"\x{
100}
";
600 print
"$a = $b\n
";
</pre>
601 <p>the output string will be UTF-
8-encoded
<code>ab\x80c = \x{
100}\n
</code>, but
602 <a href=
"file://C|\msysgit\mingw\html/pod/perlvar.html#item__a"><code>$a
</code></a> will stay byte-encoded.
</p>
603 <p>Sometimes you might really need to know the byte length of a string
604 instead of the character length. For that use either the
605 <code>Encode::encode_utf8()
</code> function or the
<code>bytes
</code> pragma and its only
606 defined function
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_length"><code>length()
</code></a>:
</p>
608 my $unicode = chr(
0x100);
609 print length($unicode),
"\n
"; # will print
1
611 print length(Encode::encode_utf8($unicode)),
"\n
"; # will print
2
613 print length($unicode),
"\n
"; # will also print
2
614 # (the
0xC4 0x80 of the UTF-
8)
</pre>
617 <p>How Do I Detect Data That's Not Valid In a Particular Encoding?
</p>
618 <p>Use the
<code>Encode
</code> package to try converting it.
621 use Encode 'decode_utf8';
622 if (decode_utf8($string_of_bytes_that_I_think_is_utf8)) {
627 <p>For UTF-
8 only, you can use:
</p>
630 @chars = unpack(
"U0U*
", $string_of_bytes_that_I_think_is_utf8);
</pre>
631 <p>If invalid, a
<code>Malformed UTF-
8 character (byte
0x##) in unpack
</code>
632 warning is produced. The ``U0'' means ``expect strictly UTF-
8 encoded
633 Unicode''. Without that the
<code>unpack(
"U*
", ...)
</code> would accept also
634 data like
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chr"><code>chr(
0xFF</code></a>), similarly to the
<code>pack
</code> as we saw earlier.
</p>
637 <p>How Do I Convert Binary Data Into a Particular Encoding, Or Vice Versa?
</p>
638 <p>This probably isn't as useful as you might think.
639 Normally, you shouldn't need to.
</p>
640 <p>In one sense, what you are asking doesn't make much sense: encodings
641 are for characters, and binary data are not ``characters'', so converting
642 ``data'' into some encoding isn't meaningful unless you know in what
643 character set and encoding the binary data is in, in which case it's
644 not just binary data, now is it?
</p>
645 <p>If you have a raw sequence of bytes that you know should be
646 interpreted via a particular encoding, you can use
<code>Encode
</code>:
</p>
648 use Encode 'from_to';
649 from_to($data,
"iso-
8859-
1",
"utf-
8"); # from latin-
1 to utf-
8</pre>
650 <p>The call to
<code>from_to()
</code> changes the bytes in
<code>$data
</code>, but nothing
651 material about the nature of the string has changed as far as Perl is
652 concerned. Both before and after the call, the string
<code>$data
</code>
653 contains just a bunch of
8-bit bytes. As far as Perl is concerned,
654 the encoding of the string remains as ``system-native
8-bit bytes''.
</p>
655 <p>You might relate this to a fictional 'Translate' module:
</p>
658 my $phrase =
"Yes
";
659 Translate::from_to($phrase, 'english', 'deutsch');
660 ## phrase now contains
"Ja
"</pre>
661 <p>The contents of the string changes, but not the nature of the string.
662 Perl doesn't know any more after the call than before that the
663 contents of the string indicates the affirmative.
</p>
664 <p>Back to converting data. If you have (or want) data in your system's
665 native
8-bit encoding (e.g. Latin-
1, EBCDIC, etc.), you can use
666 pack/unpack to convert to/from Unicode.
</p>
668 $native_string = pack(
"C*
", unpack(
"U*
", $Unicode_string));
669 $Unicode_string = pack(
"U*
", unpack(
"C*
", $native_string));
</pre>
670 <p>If you have a sequence of bytes you
<strong>know
</strong> is valid UTF-
8,
671 but Perl doesn't know it yet, you can make Perl a believer, too:
</p>
673 use Encode 'decode_utf8';
674 $Unicode = decode_utf8($bytes);
</pre>
675 <p>You can convert well-formed UTF-
8 to a sequence of bytes, but if
676 you just want to convert random binary data into UTF-
8, you can't.
677 <strong>Any random collection of bytes isn't well-formed UTF-
8</strong>. You can
678 use
<code>unpack(
"C*
", $string)
</code> for the former, and you can create
679 well-formed Unicode data by
<code>pack(
"U*
",
0xff, ...)
</code>.
</p>
682 <p>How Do I Display Unicode? How Do I Input Unicode?
</p>
683 <p>See
<a href=
"http://www.alanwood.net/unicode/">http://www.alanwood.net/unicode/
</a> and
684 <a href=
"http://www.cl.cam.ac.uk/~mgk25/unicode.html">http://www.cl.cam.ac.uk/~mgk25/unicode.html
</a></p>
687 <p>How Does Unicode Work With Traditional Locales?
</p>
688 <p>In Perl, not very well. Avoid using locales through the
<code>locale
</code>
689 pragma. Use only one or the other. But see
<a href=
"file://C|\msysgit\mingw\html/pod/perlrun.html">the perlrun manpage
</a> for the
690 description of the
<code>-C
</code> switch and its environment counterpart,
691 <code>$ENV{PERL_UNICODE}
</code> to see how to enable various Unicode features,
692 for example by using locale settings.
</p>
697 <h2><a name=
"hexadecimal_notation">Hexadecimal Notation
</a></h2>
698 <p>The Unicode standard prefers using hexadecimal notation because
699 that more clearly shows the division of Unicode into blocks of
256 characters.
700 Hexadecimal is also simply shorter than decimal. You can use decimal
701 notation, too, but learning to use hexadecimal just makes life easier
702 with the Unicode standard. The
<code>U+HHHH
</code> notation uses hexadecimal,
704 <p>The
<code>0x
</code> prefix means a hexadecimal number, the digits are
0-
9 <em>and
</em>
705 a-f (or A-F, case doesn't matter). Each hexadecimal digit represents
706 four bits, or half a byte.
<code>print
0x...,
"\n
"</code> will show a
707 hexadecimal number in decimal, and
<code>printf
"%x\n
", $decimal
</code> will
708 show a decimal number in hexadecimal. If you have just the
709 ``hex digits'' of a hexadecimal number, you can use the
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_hex"><code>hex()
</code></a> function.
</p>
711 print
0x0009,
"\n
"; #
9
712 print
0x000a,
"\n
"; #
10
713 print
0x000f,
"\n
"; #
15
714 print
0x0010,
"\n
"; #
16
715 print
0x0011,
"\n
"; #
17
716 print
0x0100,
"\n
"; #
256</pre>
718 print
0x0041,
"\n
"; #
65</pre>
720 printf
"%x\n
",
65; #
41
721 printf
"%#x\n
",
65; #
0x41</pre>
723 print hex(
"41"),
"\n
"; #
65</pre>
726 <h2><a name=
"further_resources">Further Resources
</a></h2>
729 <p>Unicode Consortium
</p>
731 <a href=
"http://www.unicode.org/">http://www.unicode.org/
</a></pre>
736 <a href=
"http://www.unicode.org/unicode/faq/">http://www.unicode.org/unicode/faq/
</a></pre>
739 <p>Unicode Glossary
</p>
741 <a href=
"http://www.unicode.org/glossary/">http://www.unicode.org/glossary/
</a></pre>
744 <p>Unicode Useful Resources
</p>
746 <a href=
"http://www.unicode.org/unicode/onlinedat/resources.html">http://www.unicode.org/unicode/onlinedat/resources.html
</a></pre>
749 <p>Unicode and Multilingual Support in HTML, Fonts, Web Browsers and Other Applications
</p>
751 <a href=
"http://www.alanwood.net/unicode/">http://www.alanwood.net/unicode/
</a></pre>
754 <p>UTF-
8 and Unicode FAQ for Unix/Linux
</p>
756 <a href=
"http://www.cl.cam.ac.uk/~mgk25/unicode.html">http://www.cl.cam.ac.uk/~mgk25/unicode.html
</a></pre>
759 <p>Legacy Character Sets
</p>
761 <a href=
"http://www.czyborra.com/">http://www.czyborra.com/
</a>
762 <a href=
"http://www.eki.ee/letter/">http://www.eki.ee/letter/
</a></pre>
765 <p>The Unicode support files live within the Perl installation in the
768 $Config{installprivlib}/unicore
</pre>
769 <p>in Perl
5.8.0 or newer, and
</p>
771 $Config{installprivlib}/unicode
</pre>
772 <p>in the Perl
5.6 series. (The renaming to
<em>lib/unicore
</em> was done to
773 avoid naming conflicts with lib/Unicode in case-insensitive filesystems.)
774 The main Unicode data file is
<em>UnicodeData.txt
</em> (or
<em>Unicode
.301</em> in
775 Perl
5.6.1.) You can find the
<code>$Config{installprivlib}
</code> by
</p>
777 perl
"-V:installprivlib
"</pre>
778 <p>You can explore various information from the Unicode data files using
779 the
<code>Unicode::UCD
</code> module.
</p>
785 <h1><a name=
"unicode_in_older_perls">UNICODE IN OLDER PERLS
</a></h1>
786 <p>If you cannot upgrade your Perl to
5.8.0 or later, you can still
787 do some Unicode processing by using the modules
<code>Unicode::String
</code>,
788 <code>Unicode::Map8
</code>, and
<code>Unicode::Map
</code>, available from CPAN.
789 If you have the GNU recode installed, you can also use the
790 Perl front-end
<code>Convert::Recode
</code> for character conversions.
</p>
791 <p>The following are fast conversions from ISO
8859-
1 (Latin-
1) bytes
792 to UTF-
8 bytes and back, the code works even with older Perl
5 versions.
</p>
794 # ISO
8859-
1 to UTF-
8
795 s/([\x80-\xFF])/chr(
0xC0|ord($
1)
>>6).chr(
0x80|ord($
1)
&0x3F)/eg;
</pre>
797 # UTF-
8 to ISO
8859-
1
798 s/([\xC2\xC3])([\x80-\xBF])/chr(ord($
1)
<<6&0xC0|ord($
2)
&0x3F)/eg;
</pre>
802 <h1><a name=
"see_also">SEE ALSO
</a></h1>
803 <p><a href=
"file://C|\msysgit\mingw\html/pod/perlunicode.html">the perlunicode manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/Encode.html">the Encode manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/encoding.html">the encoding manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/open.html">the open manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/utf8.html">the utf8 manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/bytes.html">the bytes manpage
</a>,
804 <a href=
"file://C|\msysgit\mingw\html/pod/perlretut.html">the perlretut manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/pod/perlrun.html">the perlrun manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/Unicode/Collate.html">the Unicode::Collate manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/lib/Unicode/Normalize.html">the Unicode::Normalize manpage
</a>,
805 <a href=
"file://C|\msysgit\mingw\html/lib/Unicode/UCD.html">the Unicode::UCD manpage
</a></p>
809 <h1><a name=
"acknowledgments">ACKNOWLEDGMENTS
</a></h1>
810 <p>Thanks to the kind readers of the
<a href=
"mailto:perl5-porters@perl.org,">perl5-porters@perl.org,
</a>
811 <a href=
"mailto:perl-unicode@perl.org,">perl-unicode@perl.org,
</a> <a href=
"mailto:linux-utf8@nl.linux.org,">linux-utf8@nl.linux.org,
</a> and
<a href=
"mailto:unicore@unicode.org">unicore@unicode.org
</a>
812 mailing lists for their valuable feedback.
</p>
816 <h1><a name=
"author__copyright__and_license">AUTHOR, COPYRIGHT, AND LICENSE
</a></h1>
817 <p>Copyright
2001-
2002 Jarkko Hietaniemi
<<a href=
"mailto:jhi@iki.fi">jhi@iki.fi
</a>></p>
818 <p>This document may be distributed under the same terms as Perl itself.
</p>
819 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
820 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
821 <big><strong><span class=
"block"> perluniintro - Perl Unicode introduction
</span></strong></big>