From 8de246aa37e3dbb877251918110ae0a2360e0523 Mon Sep 17 00:00:00 2001 From: kados Date: Wed, 8 Mar 2006 18:12:42 +0000 Subject: [PATCH] Hopefully a fix for hdl's accented characters not working. NOTE: BY DEFAULT, MARC::File::XML will turn UTF-8 into MARC-8 in the new_as_xml method ... to keep it as UTF-8 you must specify a second parameter 'UTF-8' --- C4/Search.pm | 4 ++-- C4/SearchMarc.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 34020503ce..ffb59382b4 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -90,7 +90,7 @@ sub search { my @results; while ( $i < $n && $i < $number ) { $raw = $rs->record($i)->raw(); - my $record = MARC::Record->new_from_xml($raw); + my $record = MARC::Record->new_from_xml($raw, 'UTF-8'); my $line = MARCmarc2koha( $dbh, $record ); push @results, $line; # push @results,$raw; @@ -124,7 +124,7 @@ sub get_record { print "Error ", $@->code(), ": ", $@->message(), "\n"; } ###$raw - my $record = MARC::Record->new_from_xml($raw); + my $record = MARC::Record->new_from_xml($raw, 'UTF-8'); ###$record return ($record); } diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index 074a3bf1d8..a0c809914f 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -267,7 +267,7 @@ sub catalogsearch { # get the MARC record (in XML)... # warn "REC $i = ".$rs->record($i)->raw(); # FIXME : it's a silly way to do things : XML => MARC::Record => hash. We had better developping a XML=> hash (in biblio.pm) - my $record = MARC::Record->new_from_xml($rs->record($i)->raw()); + my $record = MARC::Record->new_from_xml($rs->record($i)->raw(), 'UTF-8'); # transform it into a meaningul hash my $line = MARCmarc2koha($dbh,$record); my $biblionumber=$line->{biblionumber}; -- 2.39.5