5 $enc{caller()} = $_[1] if $_[1];
13 require "utf8_heavy.pl";
22 utf8 - Perl pragma to enable/disable UTF-8 in source code
31 WARNING: The implementation of Unicode support in Perl is incomplete.
32 Expect sudden and unannounced changes!
34 The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the
35 program text in the current lexical scope. The C<no utf8> pragma
36 tells Perl to switch back to treating the source text as literal
37 bytes in the current lexical scope.
39 This pragma is primarily a compatibility device. Perl versions
40 earlier than 5.6 allowed arbitrary bytes in source code, whereas
41 in future we would like to standardize on the UTF-8 encoding for
42 source text. Until UTF-8 becomes the default format for source
43 text, this pragma should be used to recognize UTF-8 in the source.
44 When UTF-8 becomes the standard source format, this pragma will
45 effectively become a no-op.
47 Enabling the C<utf8> pragma has the following effects:
53 Bytes in the source text that have their high-bit set will be treated
54 as being part of a literal UTF-8 character. This includes most literals
55 such as identifiers, string constants, constant regular expression patterns
60 In the absence of inputs marked as UTF-8, regular expressions within the
61 scope of this pragma will default to using character semantics instead
64 @bytes_or_chars = split //, $data; # may split to bytes if data
67 use utf8; # force char semantics
68 @chars = split //, $data; # splits characters
73 L<perlunicode>, L<bytes>