open marc output file with :utf8 layer, with previous fix it fixes encoding in MARC...
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 8 Sep 2006 17:48:43 +0000 (17:48 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 8 Sep 2006 17:48:43 +0000 (17:48 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@662 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Output/MARC.pm

index 33f5ace..a05d804 100644 (file)
@@ -16,11 +16,11 @@ WebPAC::Output::MARC - Create MARC records from C<marc_*> normalisation rules
 
 =head1 VERSION
 
-Version 0.02
+Version 0.03
 
 =cut
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 =head1 SYNOPSIS
 
@@ -57,6 +57,7 @@ sub new {
        if (my $path = $self->{path}) {
                open($self->{fh}, '>', $path) ||
                        $log->logdie("can't open MARC output $path: $!");
+               binmode($self->{fh}, ':utf8');
 
                $log->info("Creating MARC export file $path", $self->{lint} ? ' (with lint)' : '', "\n");
        } else {
@@ -150,10 +151,7 @@ sub add {
                );
        }
 
-       {
-               use bytes;
-               print {$self->{fh}} $marc->as_usmarc;
-       }
+       print {$self->{fh}} $marc->as_usmarc;
 
 }