[Koha-patches] [PATCH] Bugfixes #2773 - Hide NSB and NSE characters

Frederic Demians f.demians at tamil.fr
Tue Feb 10 12:35:12 CET 2009


MARC21 and UNIMARC biblio records can contains non-sorting special
characters, NSB and NSE. For details:

  http://www.loc.gov/marc/nonsorting.html

Those characters are improperly displayed by web browsers as a square
containing character hexadecimal value (88 ou 89). 

This patch filters NSB and NSE when reading biblio records
from DB (not from Zebra).
---
 C4/Biblio.pm |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/C4/Biblio.pm b/C4/Biblio.pm
index 54d3cab..1c4819a 100644
--- a/C4/Biblio.pm
+++ b/C4/Biblio.pm
@@ -509,6 +509,14 @@ sub GetBiblioData {
     $data = $sth->fetchrow_hashref;
     $sth->finish;
 
+    # FIXME: Won't work for XSLT display
+    foreach my $fieldname ( keys %$data ) {
+        my $value = $data->{ $fieldname };
+        $value =~ s/\x{0088}//g;
+        $value =~ s/\x{0089}//g;
+        $data->{ $fieldname } = $value;
+    }
+
     return ($data);
 }    # sub GetBiblioData
 
-- 
1.5.5.GIT




More information about the Koha-patches mailing list