[Koha-patches] [PATCH] Bug 11054: Specify utf8 encoding when creating a child record

Colin Campbell colin.campbell at ptfs-europe.com
Tue Oct 15 16:21:06 CEST 2013


When the only non-ascii characters in a new child record
are latin + diacritic in the range covered by Latin-1 they
are not being added to a new child record correctly encoded.
Explicitly setting the record's encodiing ensures that
they are interpreted correctly.

see "Unicode Bug" in perldoc perlunicode for background on
why these characters are special
---
 cataloguing/addbiblio.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl
index cb40396..841c6c1 100755
--- a/cataloguing/addbiblio.pl
+++ b/cataloguing/addbiblio.pl
@@ -821,6 +821,7 @@ if ($hostbiblionumber) {
 if ($parentbiblio) {
     my $marcflavour = C4::Context->preference('marcflavour');
     $record = MARC::Record->new();
+    $record->encoding( 'UTF-8' );
     my $hostfield = prepare_host_field($parentbiblio,$marcflavour);
     if ($hostfield) {
         $record->append_fields($hostfield);
-- 
1.8.3.1



More information about the Koha-patches mailing list