sub _get_locale_encoding {
unless (defined $locale_encoding) {
# I18N::Langinfo isn't available everywhere
- eval "use I18N::Langinfo qw(langinfo CODESET)";
- unless ($@) {
+ eval {
+ require I18N::Langinfo;
+ I18N::Langinfo->import(qw(langinfo CODESET));
$locale_encoding = langinfo(CODESET());
+ };
+ unless ($@) {
+ print "# locale_encoding = $locale_encoding\n";
}
my $country_language;
if (not $locale_encoding && in_locale()) {
$type = 'IO';
$dscp = ":$1";
} else {
- $dscp = shift(@args);
+ $dscp = shift(@args) || '';
}
my @val;
foreach my $layer (split(/\s+/,$dscp)) {
use open IO => ":encoding(iso-8859-7)";
use open IO => ':locale';
-
+
use open ':utf8';
use open ':locale';
use open ':encoding(iso-8859-7)';
declared defaults.
With the C<IN> subpragma you can declare the default layers
-of input sterams, and with the C<OUT> subpragma you can declare
+of input streams, and with the C<OUT> subpragma you can declare
the default layers of output streams. With the C<IO> subpragma
you can control both input and output streams simultaneously.