Bug 39485: Fix wide character in print-warn in opac-export

Similar change in intranet counterpart: catalogue/export.

Test plan:
Verify no warning anymore when using ris or isbd when record
contains specific Unicode character(s).

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I could not trigger "Wide character" for RIS in the OPAC, but for
ISBD I can see it removes that warning.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Marcel de Rooy 2025-03-31 08:28:09 +00:00 committed by Katrin Fischer
parent b3c93d1ea2
commit 81359cc8a6
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ if ( $op eq "export" ) {
( $error, $marc ) = marc2marc( $marc, 'marcstd', C4::Context->preference('marcflavour') );
$format = "marcstd";
}
if ( $format =~ /utf8/ or $format =~ /marcstd/ ) {
if ( $format ne 'marc8' ) {
binmode STDOUT, ':encoding(UTF-8)';
}
print $query->header(

View File

@ -162,6 +162,7 @@ if ($error) {
print $query->escapeHTML("$error");
print $query->end_html();
} else {
binmode STDOUT, ':encoding(UTF-8)' if $format ne 'marc8';
if ( $format eq 'marc8' ) {
print $query->header(
-type => 'application/marc',
@ -181,7 +182,6 @@ if ($error) {
-attachment => "$file_pre$file_id.$format"
);
} else {
binmode STDOUT, ':encoding(UTF-8)';
print $query->header(
-type => 'application/octet-stream',
-charset => 'utf-8',