/[webpac2]/trunk/lib/WebPAC/Output/MARC.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output/MARC.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1106 by dpavlin, Wed Oct 31 18:07:33 2007 UTC revision 1107 by dpavlin, Mon Aug 4 21:47:27 2008 UTC
# Line 34  L<WebPAC::Normalize>. Line 34  L<WebPAC::Normalize>.
34    
35    my $marc = new WebPAC::Output::MARC(    my $marc = new WebPAC::Output::MARC(
36          path => '/path/to/output.marc',          path => '/path/to/output.marc',
         native_encoding => 'iso-8859-2',  
37          marc_encoding => 'utf-8',          marc_encoding => 'utf-8',
38          lint => 1,          lint => 1,
39          dump => 0,          dump => 0,
# Line 64  sub new { Line 63  sub new {
63                  $log->logconfess("new called without path");                  $log->logconfess("new called without path");
64          }          }
65    
         $self->{native_encoding} ||= 'iso-8859-2';  
66          $self->{marc_encoding} ||= 'utf-8';          $self->{marc_encoding} ||= 'utf-8';
67    
68          $self ? return $self : return undef;          $self ? return $self : return undef;
# Line 109  sub add { Line 107  sub add {
107          foreach my $j ( 0 .. $#$fields ) {          foreach my $j ( 0 .. $#$fields ) {
108                  foreach my $i ( 0 .. ( ( $#{$fields->[$j]} - 3 ) / 2 ) ) {                  foreach my $i ( 0 .. ( ( $#{$fields->[$j]} - 3 ) / 2 ) ) {
109                          my $f = $fields->[$j]->[ ($i * 2) + 4 ];                          my $f = $fields->[$j]->[ ($i * 2) + 4 ];
                         $f = decode( $self->{native_encoding}, $f );  
110                          $fields->[$j]->[ ($i * 2) + 4 ] = $f;                          $fields->[$j]->[ ($i * 2) + 4 ] = $f;
111                  }                  }
112          }          }

Legend:
Removed from v.1106  
changed lines
  Added in v.1107

  ViewVC Help
Powered by ViewVC 1.1.26