[Koha-devel] x-koha-query header doesn't support UTF-8 data

David Cook dcook at prosentient.com.au
Mon Dec 5 04:32:24 CET 2022


Hi all,

 

It turns out the “x-koha-query” header can’t support any value that isn’t ISO-8859-1 encoded. That really limits the number of languages that can use that header, so I think it has to be removed from Koha. See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32401 for more details.

 

I bumped into the problem via the DataTables in the “Pending Orders” table when I was trying to search through the pending orders using an Arabic string. It just silently failed, so I started digging. When I opened the F12 tools, clicked “Sources”, and clicked “Pause on caught exceptions”, and then ran my search… I got a nice “Paused in debugger” message along with the caught exception: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point.

 

Feel free to try it yourself using Arabic (خمسة), Chinese (五), or whatever language you like that requires UTF-8. 

 

I find the kohaTable code in koha-tmpl/intranet-tmpl/prog/js/datatables.js to be unwieldy so hesitant to touch it myself. I think Agustin, Tomas, and Jonathan have the best understanding of it, so they might be best positioned to fix this one.

 

Not sure if everything will need to be refactored to POSTs or if the queries can be put into the “q” parameter, but anyway… just raising awareness about it here for now. Curious to hear what people think.

 

Cheers,

 

David Cook

Senior Software Engineer

Prosentient Systems

Suite 7.03

6a Glen St

Milsons Point NSW 2061

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20221205/4ad03962/attachment.htm>


More information about the Koha-devel mailing list