charset: fixed bug that prevented ISO-5426 conversion
authorGalen Charlton <galen.charlton@liblime.com>
Sat, 2 Feb 2008 05:23:51 +0000 (23:23 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 3 Feb 2008 13:24:45 +0000 (07:24 -0600)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Charset.pm

index 329c416..54a1322 100644 (file)
@@ -193,6 +193,7 @@ sub MarcToUTF8Record {
         } elsif ($source_encoding =~ /marc-?8/i) {
             @errors = _marc_marc8_to_utf8($marc_record, $marc_flavour);
         } elsif ($source_encoding =~ /5426/) {
+            @errors = _marc_iso5426_to_utf8($marc_record, $marc_flavour);
         } else {
             # assume any other character encoding is for Text::Iconv
             @errors = _marc_to_utf8_via_text_iconv($marc_record, $marc_flavour, 'iso-8859-1');
@@ -234,7 +235,7 @@ sub SetMarcUnicodeFlag {
         substr($leader, 9, 1) = 'a';
         $marc_record->leader($leader); 
     } elsif ($marc_flavour eq "UNIMARC") {
-        if (my $field = $marc_record->fields('100')) {
+        if (my $field = $marc_record->field('100')) {
             my $sfa = $field->subfield('a');
             substr($sfa, 26, 4) = '5050';
             $field->update('a' => $sfa);