To reproduce: - catalog a record that includes umlauts äöü - write a report, that has the record in the result set - access the JSON output of the report .../cgi-bin/koha/svc/report?id=1 - verify the umlaut displays wrong - switch the encoding in the browser to 'western'/latin1 - verify the umlaut now displays correctly
Created attachment 27333 [details] [review] 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. http://bugs.koha-community.org/show_bug.cgi?id=9915
Created attachment 27334 [details] [review] Bug 12114: Fix encoding problem with reports JSON web service (staff) Repeat tests from first patch, but this time, access the report with your staff client base URL. <Staff BaseURL>/cgi-bin/koha/svc/report?id=<reportid> Based on paste from Galen Charlton. http://bugs.koha-community.org/show_bug.cgi?id=9915
Created attachment 27360 [details] [review] [Signed-off] 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. http://bugs.koha-community.org/show_bug.cgi?id=9915 Followed test plan. Result as expected. Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 27361 [details] [review] [Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (staff) Repeat tests from first patch, but this time, access the report with your staff client base URL. <Staff BaseURL>/cgi-bin/koha/svc/report?id=<reportid> Based on paste from Galen Charlton. http://bugs.koha-community.org/show_bug.cgi?id=9915 Followed test plan. Result as expected. Signed-off-by: Marc Véron <veron@veron.ch>
Patch uses JSON::XS which isn't in our list of dependencies. It may not be needed though. JSON has the same subroutine.
(In reply to Kyle M Hall from comment #5) > Patch uses JSON::XS which isn't in our list of dependencies. It may not be > needed though. JSON has the same subroutine. It appears that both JSON:PP and JSON:XS support encode_json.
(In reply to Kyle M Hall from comment #6) > (In reply to Kyle M Hall from comment #5) > > Patch uses JSON::XS which isn't in our list of dependencies. It may not be > > needed though. JSON has the same subroutine. > > It appears that both JSON:PP and JSON:XS support encode_json. I have verified encode_json works just fine using both PP and XS versions of JSON.
Created attachment 27619 [details] [review] Bug 12114: Fix encoding problem with reports JSON web service (opac)
Created attachment 27620 [details] [review] Bug 12114: Fix encoding problem with reports JSON web service (staff)
Created attachment 27621 [details] [review] Bug 12114 [QA Followup] - Use JSON instead of JSON::XS
Pushed to master. Thanks, Katrin!
Thanks Galen for providing the solution :)