Updating a record by sending a POST request with the MARCXML data Koha's /svc/bib endpoint can result in mangled characters in the saved record.
Created attachment 29732 [details] [review] Bug 12581 - Fix encoding issues in /svc/bib endpoint Updating a record by sending a POST request with the MARCXML data Koha's /svc/bib endpoint can result in mangled characters in the saved record. By contrast, the /svc/new_bib endpoint, for creating a new record, correctly fixes theese encoding issues. This patch replicates the fix from svc/new_bib to svc/bib. Test plan * Update a record by sending MARCXML to the /svc/bib endpoint. The record should contain non-latin characters, for example æ,ø, å. * Observe that the returned response, and the record in the database has mangled characters. * Apply the patch * Repeat the first step * Observe that the record now is free from encoding errors.
Created attachment 30612 [details] [review] Bug 12581 - Fix encoding issues in /svc/bib endpoint Updating a record by sending a POST request with the MARCXML data Koha's /svc/bib endpoint can result in mangled characters in the saved record. By contrast, the /svc/new_bib endpoint, for creating a new record, correctly fixes theese encoding issues. This patch replicates the fix from svc/new_bib to svc/bib. Test plan * Update a record by sending MARCXML to the /svc/bib endpoint. The record should contain non-latin characters, for example æ,ø, å. * Observe that the returned response, and the record in the database has mangled characters. * Apply the patch * Repeat the first step * Observe that the record now is free from encoding errors. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
I am making my first steps with the svc API and I managed to update a record using: curl 'http://localhost:8080/cgi-bin/koha/svc/bib/30' --cookie /tmp/svc.cookies --header "Content-type: text/xml" --data @/home/katrin/Downloads/bib-30.marcxml But I can't reproduce the encoding problem :( I tried with a record containing the characters listed in the patch and Arabic.
Some additional information: - I had downloaded the record from my Koha database. - I changed it in an editor, the changes were reflected in what I saw on command line and in Koha after the update. - All diacritics showed up correctly at all times. Could you please try again if the problem is still there for you and provide me with a test plan and an example record?
Hi Katrin, Thanks for QA! You're right. Somehow, it now mysteriously works for me too on master. I can't understand why. It must have been something weird with my environment, or else some changes in master which now resolved the issue. Either way, I'm happy to close this. The less code the better:)
Hi Petter, thx for retesting! Just changing the status a bit to imply that this patch isn't needed for now.