X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FEncode%2Fencoding.pm;h=77ba4472a23a3cfcbc3bb692953a3dff9e4c1a78;hb=4ac71550d23cca4632a2bcdfcb1d83a6bf705e45;hp=7b8eee416f73b4b3385e238c9e9aa32749a6d46f;hpb=44b3b9c710e4ffb3c3fb08c702ea4f981c927631;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm index 7b8eee4..77ba447 100644 --- a/ext/Encode/encoding.pm +++ b/ext/Encode/encoding.pm @@ -1,6 +1,6 @@ -# $Id: encoding.pm,v 2.6 2007/04/22 14:56:12 dankogai Exp dankogai $ +# $Id: encoding.pm,v 2.7 2008/03/12 09:51:11 dankogai Exp $ package encoding; -our $VERSION = do { my @r = ( q$Revision: 2.6 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; +our $VERSION = '2.6_01'; use Encode; use strict; @@ -50,11 +50,11 @@ sub _get_locale_encoding { no warnings 'uninitialized'; - if ( not $locale_encoding && in_locale() ) { - if ( $ENV{LC_ALL} =~ /^([^.]+)\.([^.]+)$/ ) { + if ( (not $locale_encoding) && in_locale() ) { + if ( $ENV{LC_ALL} =~ /^([^.]+)\.([^.@]+)(@.*)?$/ ) { ( $country_language, $locale_encoding ) = ( $1, $2 ); } - elsif ( $ENV{LANG} =~ /^([^.]+)\.([^.]+)$/ ) { + elsif ( $ENV{LANG} =~ /^([^.]+)\.([^.@]+)(@.*)?$/ ) { ( $country_language, $locale_encoding ) = ( $1, $2 ); } @@ -315,22 +315,6 @@ always the same as the length of C<$/> in the native encoding. This pragma affects utf8::upgrade, but not utf8::downgrade. -=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. - -=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 @@ -628,6 +612,11 @@ unicode characters since you have to consider such things as character width (i.e. double-width for ideographs) and directions (i.e. BIDI for Arabic and Hebrew). +=item Thread safety + +C is not thread-safe (i.e., do not use in threaded +applications). + =back =head2 The Logic of :locale