summaryrefslogtreecommitdiff
path: root/lib/open.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-07-10 03:55:38 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-10 03:55:38 +0000
commit56fb2e42d4cdb8173645949ca678913a617dd9fb (patch)
tree526683513fa8cf6bf2adf9fbf016e41a47542050 /lib/open.pm
parent8e86646e958d6dc7566f90f497756b5c18800b82 (diff)
downloadperl-56fb2e42d4cdb8173645949ca678913a617dd9fb.tar.gz
Require I18N::Langinfo, not use.
p4raw-id: //depot/perl@11250
Diffstat (limited to 'lib/open.pm')
-rw-r--r--lib/open.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/open.pm b/lib/open.pm
index 8eff354f37..eda8658696 100644
--- a/lib/open.pm
+++ b/lib/open.pm
@@ -10,7 +10,8 @@ sub in_locale { $^H & $locale::hint_bits }
sub _get_locale_encoding {
unless (defined $locale_encoding) {
- eval { use I18N::Langinfo qw(langinfo CODESET) };
+ eval { require I18N::Langinfo;
+ import I18N::Langinfo qw(langinfo CODESET) };
unless ($@) {
$locale_encoding = langinfo(CODESET);
}
@@ -32,11 +33,11 @@ sub _get_locale_encoding {
if (defined $locale_encoding &&
$locale_encoding eq 'euc' &&
defined $country_language) {
- if ($country_language =~ /^ja_JP|japan(?:ese)$/i) {
+ if ($country_language =~ /^ja_JP|japan(?:ese)?$/i) {
$locale_encoding = 'eucjp';
- } elsif ($country_language =~ /^ko_KR|korea(?:n)$/i) {
+ } elsif ($country_language =~ /^ko_KR|korea(?:n)?$/i) {
$locale_encoding = 'euckr';
- } elsif ($country_language =~ /^zh_TW|taiwan(?:ese)$/i) {
+ } elsif ($country_language =~ /^zh_TW|taiwan(?:ese)?$/i) {
$locale_encoding = 'euctw';
}
croak "Locale encoding 'euc' too ambiguous"