From 8f006fd002bca0967dac7a21d10474de745ba0f5 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 21 Apr 2014 00:01:19 +0200 Subject: [PATCH] Bug 12114: Fix encoding problem with reports JSON web service (opac) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - catalog a record that includes umlauts äöü - write a report, that has the record in the result set - access the JSON output of the report Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- opac/svc/report | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opac/svc/report b/opac/svc/report index 1ded9c94b0..0b17a4de72 100755 --- a/opac/svc/report +++ b/opac/svc/report @@ -24,7 +24,7 @@ use Modern::Perl; use C4::Reports::Guided; -use JSON; +use JSON::XS; use CGI; use Koha::Cache; @@ -70,7 +70,7 @@ unless ($json_text) { else { $lines = $sth->fetchall_arrayref; } - $json_text = to_json($lines); + $json_text = encode_json($lines); if ($cache_active) { $cache->set_in_cache( $cache_key, $json_text, @@ -78,7 +78,7 @@ unless ($json_text) { } } else { - $json_text = to_json($errors); + $json_text = encode_json($errors); } }