[Koha-cvs] koha/C4 Biblio.pm [rel_3_0]

paul poulain paul at koha-fr.org
Wed Nov 15 15:49:39 CET 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	paul poulain <tipaul>	06/11/15 14:49:39

Modified files:
	C4             : Biblio.pm 

Log message:
	in some cases, there are invalid utf8 chars in XML (at least in SANOP). this commit remove them on the fly.
	Not sure it's a good idea to keep them in biblio.pm, let me know your opinion on koha-devel if you think it's a bad idea...

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&only_with_tag=rel_3_0&r1=1.178.2.20&r2=1.178.2.21

Patches:
Index: Biblio.pm
===================================================================
RCS file: /sources/koha/koha/C4/Biblio.pm,v
retrieving revision 1.178.2.20
retrieving revision 1.178.2.21
diff -u -b -r1.178.2.20 -r1.178.2.21
--- Biblio.pm	31 Oct 2006 17:20:49 -0000	1.178.2.20
+++ Biblio.pm	15 Nov 2006 14:49:38 -0000	1.178.2.21
@@ -816,6 +816,10 @@
     my $sth=$dbh->prepare("select marcxml from biblioitems where biblionumber=? "  );
     $sth->execute($bibid);
     my ($marcxml)=$sth->fetchrow;
+    $marcxml =~ s/\x1e//g;
+    $marcxml =~ s/\x1f//g;
+    $marcxml =~ s/\x1d//g;
+    $marcxml =~ s/\x0f//g;
     my $record = MARC::Record->new();
     $record = MARC::Record::new_from_xml( $marcxml,"utf8",C4::Context->preference('marcflavour')) if $marcxml;
     return $record;
@@ -3678,7 +3682,7 @@
         # the koha tables
         $record=MARCgetbiblio($dbh,$biblionumber);
         $record = $record->as_xml_record() if $record;
-        #warn "RECORD".$record->as_usmarc();
+#          warn "RECORD $biblionumber => ".$record;
         $shadow="biblioservershadow";
 
     }elsif($server eq "authorityserver"){
@@ -3858,8 +3862,12 @@
 
 =cut
 
-# $Id: Biblio.pm,v 1.178.2.20 2006/10/31 17:20:49 toins Exp $
+# $Id: Biblio.pm,v 1.178.2.21 2006/11/15 14:49:38 tipaul Exp $
 # $Log: Biblio.pm,v $
+# Revision 1.178.2.21  2006/11/15 14:49:38  tipaul
+# in some cases, there are invalid utf8 chars in XML (at least in SANOP). this commit remove them on the fly.
+# Not sure it's a good idea to keep them in biblio.pm, let me know your opinion on koha-devel if you think it's a bad idea...
+#
 # Revision 1.178.2.20  2006/10/31 17:20:49  toins
 # * moving bibitemdata from search to here.
 # * using _koha_modify_biblio instead of OLDmodbiblio.





More information about the Koha-cvs mailing list