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;