} elsif ($country_language =~ /^zh_CN|chin(?:a|ese)?$/i) {
$locale_encoding = 'euc-cn';
} elsif ($country_language =~ /^zh_TW|taiwan(?:ese)?$/i) {
- $locale_encoding = 'big5';
+ $locale_encoding = 'euc-tw';
}
croak "Locale encoding 'euc' too ambiguous"
if $locale_encoding eq 'euc';
}
$std = 1;
} else {
- unless(PerlIO::Layer::->find($layer)) {
+ my $target = $layer; # the layer name itself
+ $target =~ s/^(\w+)\(.+\)$/$1/; # strip parameters
+
+ unless(PerlIO::Layer::->find($target)) {
carp("Unknown discipline layer '$layer'");
}
}
for input/output handles. For example, if both input and out are
chosen to be C<:utf8>, a C<:std> will mean that STDIN, STDOUT, and
STDERR are also in C<:utf8>. On the other hand, if only output is
-chosen to be in C<:encoding(koi8r)', a C<:std> will cause only the
+chosen to be in C<< :encoding(koi8r) >>, a C<:std> will cause only the
STDOUT and STDERR to be in C<koi8r>. The C<:locale> subpragma
implicitly turns on C<:std>.
=back
+If your locale environment variables (LANGUAGE, LC_ALL, LC_CTYPE, LANG)
+contain the strings 'UTF-8' or 'UTF8' (case-insensitive matching),
+the default encoding of your STDIN, STDOUT, and STDERR, and of
+B<any subsequent file open>, is UTF-8.
+
Directory handles may also support disciplines in future.
=head1 NONPERLIO FUNCTIONALITY