February 2012
Intermediate to advanced
1184 pages
37h 17m
English
use utf8;
The utf8 pragma declares that the Perl source for the rest of the lexical
scope is encoded as UTF-8. This lets you use Unicode string literals and
identifiers.
use utf8;
my $résumé_name = "Björk Guðmundsdóttir";
{
no utf8;
my $mojibake = '
'; # probably erroneous
}There are other features that the utf8 provides, but they are deprecated in favor
of the Encode module.
Note that as of v5.14, the compiler does not normalize identifiers, so you can’t tell the difference between different ways to form the same glyphs (using composed or decomposed characters). See Chapter 6 for details on normalization. We recommend that you normalize all of your Perl identifiers into NFC (or NFKC) to avoid situations where you have two different variables that look the same.
Read now
Unlock full access