From 4f20d4bded2af844deb9590c9167c0051ed6f97a Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 25 May 2016 18:09:27 +0100
Subject: [PATCH] Bug 16578: Same fix for the staff interface

---
 catalogue/export.pl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/catalogue/export.pl b/catalogue/export.pl
index 39cac7c..f82250d 100755
--- a/catalogue/export.pl
+++ b/catalogue/export.pl
@@ -69,6 +69,9 @@ if ($op eq "export") {
                 ($error, $marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour'));
                 $format = "marcstd";
             }
+            if ( $format =~ /utf8/ or $format =~ /marcstd/ ) {
+                binmode STDOUT, ':encoding(UTF-8)';
+            }
             print $query->header(
                 -type => 'application/octet-stream',
                 -attachment=>"bib-$biblionumber.$format");
-- 
2.8.1