From: Audrey Tang Date: Fri, 19 Mar 2004 18:27:10 +0000 (+0800) Subject: open.pm: allow upper-cased EUC X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8f6960eafa2ab3a951712db3243fe83d778df22d;p=p5sagit%2Fp5-mst-13.2.git open.pm: allow upper-cased EUC Message-Id: <20040319102710.GA91216@aut.dyndns.org> p4raw-id: //depot/perl@22538 --- diff --git a/lib/open.pm b/lib/open.pm index fa2a518..32c5118 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -3,7 +3,7 @@ use warnings; use Carp; $open::hint_bits = 0x20000; # HINT_LOCALIZE_HH -our $VERSION = '1.02'; +our $VERSION = '1.03'; my $locale_encoding; @@ -41,7 +41,7 @@ sub _get_locale_encoding { # would be excellent!) --jhi } if (defined $locale_encoding && - $locale_encoding eq 'euc' && + lc($locale_encoding) eq 'euc' && defined $country_language) { if ($country_language =~ /^ja_JP|japan(?:ese)?$/i) { $locale_encoding = 'euc-jp'; @@ -51,9 +51,9 @@ sub _get_locale_encoding { $locale_encoding = 'euc-cn'; } elsif ($country_language =~ /^zh_TW|taiwan(?:ese)?$/i) { $locale_encoding = 'euc-tw'; + } else { + croak "Locale encoding 'euc' too ambiguous"; } - croak "Locale encoding 'euc' too ambiguous" - if $locale_encoding eq 'euc'; } } }