From 85f1709d41d5d0a12d2140d13dd565c758a64df0 Mon Sep 17 00:00:00 2001 From: Magnus Enger Date: Wed, 26 May 2021 09:45:29 +0200 Subject: [PATCH] Bug 28446: Fix encoding of OverDrive content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Descriptions and titles from OverDrive have their non-ascii chars displayed wrong. To test: - Enable OverDrive - Do a search and find a book with non-ascii characters in title and/or description. E.g. "Blomsterbönder". - Check the book out - Go to "your summary" and the "OverDrive Account" tab - Observe the broken characters - Apply the patch and restart all the things - Reload the "your summary" page - Look at the "OverDrive Account" tab again, and verify the text is displayed without broken characters - Sign off --- opac/svc/overdrive | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/svc/overdrive b/opac/svc/overdrive index 89d0865dd8..eeea2c8c72 100755 --- a/opac/svc/overdrive +++ b/opac/svc/overdrive @@ -20,7 +20,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use JSON qw(encode_json); +use JSON qw(to_json); use C4::Auth qw(checkauth); use C4::Output; use Koha::Logger; @@ -159,6 +159,6 @@ sub response_bad_request { sub response { my ($data, $status_line) = @_; $status_line ||= "200 OK"; - output_with_http_headers $cgi, undef, encode_json($data), 'json', $status_line; + output_with_http_headers $cgi, undef, to_json($data), 'json', $status_line; exit; } -- 2.17.1