package utf8;
-$^U = 1 if caller and caller eq 'main'; # they are unicode aware
- # XXX split this out?
+$utf8::hint_bits = 0x00800000;
sub import {
- $^H |= 0x00800000;
+ $^H |= $utf8::hint_bits;
$enc{caller()} = $_[1] if $_[1];
}
sub unimport {
- $^H &= ~0x00800000;
+ $^H &= ~$utf8::hint_bits;
}
sub AUTOLOAD {
=head1 DESCRIPTION
WARNING: The implementation of Unicode support in Perl is incomplete.
-Expect sudden and unannounced changes!
+See L<perlunicode> for the exact details.
The C<use utf8> pragma tells the Perl parser to allow UTF-8 in the
program text in the current lexical scope. The C<no utf8> pragma
=item *
-As a side effect, when this pragma is used within the main package,
-it also enables Unicode character semantics for the entire program.
-See L<perlunicode> for more on that.
-
-[XXX: split this out into separate "pragma" and/or -C command-line
-switch?]
-
-=item *
-
In the absence of inputs marked as UTF-8, regular expressions within the
scope of this pragma will default to using character semantics instead
of byte semantics.
@chars = split //, $data; # splits characters
}
-[XXX: Should this should be enabled like chr()/sprintf("%c") by looking
-at $^U instead?]
-
=head1 SEE ALSO
-L<perlunicode>, L<byte>
+L<perlunicode>, L<bytes>
=cut