Bug 11054: Specify UTF-8 encoding when creating a child record
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 15 Oct 2013 14:09:08 +0000 (15:09 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 23:23:10 +0000 (23:23 +0000)
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

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well. No koha-qa errors.

Same test as before
1) with a record with diacritics in author/title,
2) press new child record, on new record 773adt
with mangled accents
3) Apply patch
4) Repeat 2, now good results

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested with a record containing umlauts in the title,
$t was empty before and umlauts in $a mangled.
After applying the patch fields are correctly filled and
diacritics display correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
cataloguing/addbiblio.pl

index bfb62f0..5069af9 100755 (executable)
@@ -821,6 +821,7 @@ if ($hostbiblionumber) {
 if ($parentbiblio) {
     my $marcflavour = C4::Context->preference('marcflavour');
     $record = MARC::Record->new();
+    SetMarcUnicodeFlag($record, $marcflavour);
     my $hostfield = prepare_host_field($parentbiblio,$marcflavour);
     if ($hostfield) {
         $record->append_fields($hostfield);