From 833489e4185279dd62e8cb8a608e7e8c0b44153b Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 10 Sep 2009 14:52:01 +0200 Subject: [PATCH] (bug #3598) normalize isbn Content-Type: text/plain; charset="utf-8" This patch normalize isbn's of notices imported via z39.50 --- cataloguing/z3950_search.pl | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index df2fab1..53d48a6 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -207,6 +207,26 @@ warn "query ".$query if $DEBUG; my ($charset_result, $charset_errors); ($marcrecord, $charset_result, $charset_errors) = MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]); + + # We clean the ISBN + my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblioitems.isbn',''); + + if ($bibliotag<10){ + $isbn = $marcrecord->field($bibliotag)->data; + }else{ + $isbn = $marcrecord->subfield($bibliotag,$bibliosubf); + } + + $isbn = C4::Koha::_isbn_cleanup($isbn); + + if($marcrecord->field($bibliotag)){ + if($bibliotag < 10){ + $marcrecord->field($bibliotag)->update($isbn) + }else{ + $marcrecord->field($bibliotag)->update($bibliosubf => $isbn); + } + } + ####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc ## In HEAD i change everything to UTF-8 # In rel2_2 i am not sure what encoding is so no character conversion is done here -- 1.6.0.4