[Koha-cvs] koha/C4 Koha.pm [rel_2_2]

paul poulain paul at koha-fr.org
Fri Jan 12 15:19:06 CET 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	07/01/12 14:19:06

Modified files:
	C4             : Koha.pm 

Log message:
	forgotten encoding fix

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.22.2.6&r2=1.22.2.7

Patches:
Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.6
retrieving revision 1.22.2.7
diff -u -b -r1.22.2.6 -r1.22.2.7
--- Koha.pm	22 Nov 2006 10:22:08 -0000	1.22.2.6
+++ Koha.pm	12 Jan 2007 14:19:06 -0000	1.22.2.7
@@ -668,7 +668,8 @@
     my $targetcharset="utf8" if (C4::Context->preference("TemplateEncoding") eq "utf-8");
     $targetcharset="latin1" if (C4::Context->preference("TemplateEncoding") eq "iso-8859-1");
     my $decoder = guess_encoding($marc, qw/utf8 latin1/);
-    die $decoder unless ref($decoder);
+#     die $decoder unless ref($decoder);
+    if (ref($decoder)) {
     my $newRecord=MARC::Record->new();
     foreach my $field ($record->fields()){
       if ($field->tag()<'010'){
@@ -693,11 +694,14 @@
         $newRecord->insert_grouped_field($newField);
       }
     }
-#     warn $newRecord->as_formatted(); 
+    #     warn $newRecord->as_formatted(); 
     return $newRecord;
   } else {
     return $record;
   }
+  } else {
+    return $record;
+  }
 }
 1;
 __END__





More information about the Koha-cvs mailing list