X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Futf8.pm;h=17ec37bbe21521067a12774b9ae448b820e53519;hb=3c32ced9076b91fe2c44bcada22c97a37d564b78;hp=be7cc0bf0c0577cf84ab6bf4584d21788efde1a7;hpb=393fec973b1b95a178b4b9600173880d9f93debf;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/utf8.pm b/lib/utf8.pm index be7cc0b..17ec37b 100644 --- a/lib/utf8.pm +++ b/lib/utf8.pm @@ -1,15 +1,14 @@ 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 { @@ -32,7 +31,7 @@ utf8 - Perl pragma to enable/disable UTF-8 in source code =head1 DESCRIPTION WARNING: The implementation of Unicode support in Perl is incomplete. -Expect sudden and unannounced changes! +See L for the exact details. The C pragma tells the Perl parser to allow UTF-8 in the program text in the current lexical scope. The C pragma @@ -60,15 +59,6 @@ and package names. =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 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. @@ -80,11 +70,8 @@ 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, L +L, L =cut