-# $Id: encoding.pm,v 2.6 2007/04/22 14:56:12 dankogai Exp $
+# $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;
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 );
}
This pragma affects utf8::upgrade, but not utf8::downgrade.
-=head2 Side effects
-
-If the C<encoding> 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<encoding> 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