Bug 12114

Summary: Reports web service JSON output has an encoding problem
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ReportsAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, kyle, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 12114: Fix encoding problem with reports JSON web service (opac)
Bug 12114: Fix encoding problem with reports JSON web service (staff)
[Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (opac)
[Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (staff)
Bug 12114: Fix encoding problem with reports JSON web service (opac)
Bug 12114: Fix encoding problem with reports JSON web service (staff)
Bug 12114 [QA Followup] - Use JSON instead of JSON::XS

Description Katrin Fischer 2014-04-20 21:15:54 UTC
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
Comment 1 Katrin Fischer 2014-04-20 22:12:47 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2014-04-20 22:12:55 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2014-04-21 17:45:24 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2014-04-21 17:48:08 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2014-04-25 12:46:43 UTC
Patch uses JSON::XS which isn't in our list of dependencies. It may not be needed though. JSON has the same subroutine.
Comment 6 Kyle M Hall 2014-04-25 12:49:43 UTC
(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.
Comment 7 Kyle M Hall 2014-04-25 12:53:13 UTC
(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.
Comment 8 Kyle M Hall 2014-04-25 13:00:01 UTC
Created attachment 27619 [details] [review]
Bug 12114: Fix encoding problem with reports JSON web service (opac)
Comment 9 Kyle M Hall 2014-04-25 13:00:30 UTC
Created attachment 27620 [details] [review]
Bug 12114: Fix encoding problem with reports JSON web service (staff)
Comment 10 Kyle M Hall 2014-04-25 13:01:52 UTC
Created attachment 27621 [details] [review]
Bug 12114 [QA Followup] - Use JSON instead of JSON::XS
Comment 11 Galen Charlton 2014-04-25 15:37:30 UTC
Pushed to master.  Thanks, Katrin!
Comment 12 Katrin Fischer 2014-04-25 15:39:10 UTC
Thanks Galen for providing the solution :)