Now the :locale pseudolayer *almost* works...
Jarkko Hietaniemi [Thu, 12 Jul 2001 04:47:43 +0000 (04:47 +0000)]
p4raw-id: //depot/perl@11292

lib/open.pm

index c338abf..a42f623 100644 (file)
@@ -67,12 +67,15 @@ sub import {
                if ($locale_encoding =~ /^utf-?8$/i) {
                    $layer = "utf8";
                } else {
-                   $layer = "encoding($locale_encoding)";
+                   $layer = "encoding";
                }
            }
            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;