Bug 22075: Fix encoding problem with RIS export in OPAC
authorKatrin Fischer <katrin.fischer.83@web.de>
Sun, 7 Apr 2019 16:25:28 +0000 (16:25 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 11 Apr 2019 11:47:17 +0000 (11:47 +0000)
When exporting a record with diacritics in RIS
format from the detail page in OPAC the encoding
is not correct and the diacritics appear broken.

This patch fixes it.

To test:
- Find or create a record with some special
  chars in your OPAC
- Go to the detail page
- Save as > RIS
- Verify the diacritics are broken in an editor
- Apply patch
- Repeat and verify everything now displays correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

opac/opac-export.pl

index a992d46..402d1fe 100755 (executable)
@@ -144,6 +144,13 @@ else {
             -charset    => 'utf-8',
             -attachment =>  "bib-$biblionumber.txt"
         );
+    }
+    elsif ( $format eq 'ris' ) {
+        print $query->header(
+            -type => 'text/plain',
+            -charset => 'utf-8',
+            -attachment => "bib-$biblionumber.$format"
+        );
     } else {
         binmode STDOUT, ':encoding(UTF-8)';
         print $query->header(