Bug 12114: Fix encoding problem with reports JSON web service (opac)

- catalog a record that includes umlauts äöü
- write a report, that has the record in the result set
- access the JSON output of the report
  <OPAC BaseURL/cgi-bin/koha/svc/report?id=1
- verify the umlaut displays not correctly
- switch the encoding in the browser to 'western'/latin1
- verify the umlaut now displays correctly
- apply patch
- verify umlaut now displays correctly from the beginning

Based on paste from Galen Charlton.

Followed test plan. Result as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Katrin Fischer 2014-04-21 00:01:19 +02:00 committed by Galen Charlton
parent c5a58a0457
commit 8f006fd002

View file

@ -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);
}
}