# parts of LC_ALL and LANG (the parts before the dot (if any)),
# since we have Locale::Country and Locale::Language available.
# TODO: get a database of Language -> Encoding mappings
- # (the Estonian database would be excellent!)
- # --jhi
+ # (the Estonian database at http://www.eki.ee/letter/
+ # would be excellent!) --jhi
}
if (defined $locale_encoding &&
$locale_encoding eq 'euc' &&
if ($locale_encoding =~ /^utf-?8$/i) {
$layer = "utf8";
} else {
- $layer = "encoding";
+ $layer = "encoding($locale_encoding)";
+ }
+ } else {
+ unless(PerlIO::Layer::->find($layer)) {
+ carp("Unknown discipline layer '$layer'");
}
- }
- unless(PerlIO::Layer::->find($layer)) {
- carp("Unknown discipline layer '$layer'");
- }
- if (defined $locale_encoding) {
- $layer = "$layer($locale_encoding)";
}
push(@val,":$layer");
if ($layer =~ /^(crlf|raw)$/) {
$^H{"open_$type"} = $layer;
}
}
+ # print "# type = $type, val = @val\n";
if ($type eq 'IN') {
$in = join(' ',@val);
}
=head1 SEE ALSO
-L<perlfunc/"binmode">, L<perlfunc/"open">, L<perlunicode>, L<PerlIO>
+L<perlfunc/"binmode">, L<perlfunc/"open">, L<perlunicode>, L<PerlIO>,
+L<encoding>
=cut