X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Fencoding.pm;h=1f418e3a223d73442c959517d174c3dae19954c3;hb=20e98b0f9ccd1237d697ca82b2dc40058ff7f30b;hp=cca72fc98d40e24dc99809fc3a38ac5e96ccd1ed;hpb=5a1dbf3942f1e2ad6a95fb40929e663709bd4e44;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm index cca72fc..1f418e3 100644 --- a/ext/Encode/encoding.pm +++ b/ext/Encode/encoding.pm @@ -1,9 +1,10 @@ -# $Id: encoding.pm,v 2.3 2006/05/03 18:24:10 dankogai Exp $ +# $Id: encoding.pm,v 2.4 2006/06/03 20:28:48 dankogai Exp dankogai $ package encoding; -our $VERSION = do { my @r = ( q$Revision: 2.3 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = do { my @r = ( q$Revision: 2.4 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; use Encode; use strict; +use warnings; sub DEBUG () { 0 } @@ -306,6 +307,14 @@ Will print C<2>, because C<$string> is upgraded as UTF-8. Without C, it will print C<4> instead, since C<$string> is three octets when interpreted as Latin-1. +=head2 Side effects + +If the C pragma is in scope then the lengths returned are +calculated from the length of C<$/> in Unicode characters, which is not +always the same as the length of C<$/> in the native encoding. + +This pragma affects utf8::upgrade, but not utf8::downgrade. + =head1 FEATURES THAT REQUIRE 5.8.1 Some of the features offered by this pragma requires perl 5.8.1. Most