correctly decode utf-8 from marc files
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 9 Feb 2010 20:14:23 +0000 (20:14 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 9 Feb 2010 20:14:23 +0000 (20:14 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1327 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Input/MARC.pm

index 0c19e1e..c5f7b30 100644 (file)
@@ -37,7 +37,6 @@ Returns new low-level input API object
 
   my $marc = new WebPAC::Input::MARC(
        path => '/path/to/marc.iso',
-       filter => \&code_ref,
   }
 
 =cut
@@ -53,9 +52,14 @@ sub new {
 
        $log->info("opening MARC database '$arg->{path}'");
 
+       die "no filter support any more!" if $arg->{filter};
+
        my $db = new MARC::Fast(
                marcdb => $arg->{path},
-               hash_filter => $arg->{filter},
+               hash_filter => sub {
+                       my ( $l, $nr ) = @_;
+                       Encode::decode( 'utf-8', $l );
+               },
        );
        my $db_size = $db->count - 1;   # FIXME