Bug 33994

Summary: OAI : Characters with accents are wrongly encoded
Product: Koha Reporter: Christophe TORIN <christophe.torin>
Component: Web servicesAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers
Version: 22.11   
Hardware: All   
OS: Linux   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34515
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Christophe TORIN 2023-06-13 09:38:55 UTC
Hello,

We just upgraded from Koha 20.11 to 22.11, and we are facing an issue for the OAI-PMH service :

Test case (Koha Version 22.11.04) :

- Select a document having a title containing accents (eg : "Préparation à l'oral d'espagnol")
- Everything is correctly displayed in Koha
- Query the OAIPMH service for this record (cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=oai_dc&identifier=<oai_prefix>:<biblionumber>)
- The fields with accents are badly displayed. (For this example I get "Prp̌aration  l̉'oral d'espagnol"

======

My assumption is that the metadata gets encoded twice, and the accents are then badly encoded in the result.

I spotted exactly the line in the code where the data is badly encoded, but I can't find why.

The major difference between 20.11 et 22.11 is in Koha/OAI/Server/Repository.pm, line 181 : 
Before, we used the C4::Biblio::GetMarcBiblio function (now deleted), and now it's $biblio->metadata->record

For info, $biblio->metadata->metadata is correctly encoded

Thanks
Comment 1 Fridolin Somers 2023-10-10 19:06:18 UTC
This is fixed by Bug 34467

*** This bug has been marked as a duplicate of bug 34467 ***