Re: PERL_UNICODE environment variable

2004-04-06 08:30:08
Jonathan Warden wrote:

As I understand it, the -CSD commandline option should add UTF8 to the
PerlIO layers for all file streams.  But it seems only to be applying it to
STDIN and STDOUT, and not other streams.

Anyone know what's going on?

  my $file = new IO::File($filename) or die "Error opening delimited file
  my @layers = PerlIO::get_layers($file);
  my @layers2 = PerlIO::get_layers(\*STDOUT);
  print "Layers: ".Dumper(\(_at_)layers,\(_at_)layers2);

It seems that IO::File somehow bypasses the effects of -C.  As a
workaround you can use the plain boring open().

<Prev in Thread] Current Thread [Next in Thread>