Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 75060
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: Gregory.Lepore [...] nara.gov
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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>
Download (untitled) / with headers
text/plain 721b
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
Download (untitled) / with headers
text/plain 970b
You should be careful when tweaking $PerlIO::encoding::fallback. See Encode::PerlIO for details. Dan the Maintainer Thereof On Thu Feb 16 09:33:48 2012, Gregory.Lepore@nara.gov wrote: Show quoted text
> 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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.