Skip Menu |

This queue is for tickets about the MARC-Fast CPAN distribution.

Report information
The Basics
Id: 54275
Status: resolved
Priority: 0/
Queue: MARC-Fast

People
Owner: DPAVLIN [...] cpan.org
Requestors: DPAVLIN [...] cpan.org
Cc:
AdminCc:

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



When reading utf-8 encoded marc files, as_hash won't return correctly marked utf-8 strings. Solution is to declare utf-8 encoding in open and comment out binmode in attached patch. Next version will likely introduce encoding option for open, and default to utf-8.
Subject: MARC-Fast-utf8-fix.diff
--- Fast.pm 2008-08-03 08:47:46.000000000 +0200 +++ /mnt/webpac2/usr/share/perl5/MARC/Fast.pm 2010-02-03 19:57:08.000000000 +0100 @@ -72,8 +72,8 @@ print STDERR "# opening ",$self->{marcdb},"\n" if ($self->{debug}); - open($self->{fh}, $self->{marcdb}) || croak "can't open ",$self->{marcdb},": $!"; - binmode($self->{fh}); + open($self->{fh}, "<:encoding(UTF-8)", $self->{marcdb}) || croak "can't open ",$self->{marcdb},": $!"; +# binmode($self->{fh}); $self->{count} = 0;
I decided to document workaround: hash_filter => sub { Encode::decode( 'utf-8', $_[0] ); },