Subject: | FB_DEFAULT endless loop |
Date: | Thu, 16 Feb 2012 09:33:28 -0500 |
To: | <bug-Encode [...] rt.cpan.org> |
From: | "Gregory Lepore" <Gregory.Lepore [...] nara.gov> |
Bug identified on Perlmongs.org
http://perlmonks.org/?node_id=953030
In theory, the following should work:
use PerlIO::encoding;
$PerlIO::encoding::fallback = Encode::FB_DEFAULT;
However, when I try it, for example
#!/usr/bin/perl
use PerlIO::encoding;
$PerlIO::encoding::fallback = Encode::FB_DEFAULT;
open my $fh, "<:encoding(UTF-8)", $ARGV[0] or die $!;
binmode STDOUT, ":encoding(UTF-8)";
while (<$fh>) { print }
with an input file such as (where the 'ä' is Latin-1 encoded)
foo
bär
although it does silence the warning, I do get an endless loop!
Greg Lepore
Information Technology Specialist
National Archives at College Park
8601 Adelphi Road, Rm 5320
College Park, MD 20740
Tel. (301) 837-0758