Bug 22290

Summary: Next pages results for cyrillic symbols shows decoded text in URL in anchor tag
Product: Koha Reporter: Bohdan <b.pastern4k>
Component: SearchingAssignee: Bugs List <koha-bugs>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gveranis, katrin.fischer, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Search encoding

Description Bohdan 2019-02-07 14:29:20 UTC
Created attachment 84849 [details]
Search encoding

This bug is reproduced on OPAC, intranet works fine.
Whenether i enter cyrillic symbols in search, first page results are fine, but the generated HTML page has wrong value in pagination.

Something like this is inside each li>a href element in pagination
/cgi-bin/koha/opac-search.pl?idx=kw&q=%25D1%2588%25D0%25B5%25D0%25B2%25D1%2587%25D0%25B5%25D0%25BD%25D0%25BA%25D0%25BE&offset=20&sort_by=relevance_dsc


If i click search on this link i am redirected to page that shows broken characters as you can see in attachment.
Comment 1 George Veranis 2019-02-18 15:23:11 UTC
Based on https://www.perlmonks.org/bare/?node_id=495747
and that answer 
"
Won't that escape data twice? Without actually running it, it looks like
"\x{1234}"
would be transformed by uri_escape_utf8 into
"%C8%B4"
which would be transformed by POST into
"%25C8%25B4"
while the right answer would be
"%C8%B4"

"

I add the line $query_cgi = Encode::decode_utf8(uri_unescape($query_cgi)); 
at 587 of opac-search.pl and it works
I will try later to do a patch for that.
Comment 2 Bohdan 2019-02-19 09:18:10 UTC
Thank you very much for this!
Comment 3 Katrin Fischer 2019-11-24 22:20:56 UTC
Resetting assignee to default
Comment 4 Katrin Fischer 2023-09-23 09:59:51 UTC
This appears to have been fixed. I tested a search for "Л" in the OPAC and switched pages, the breadcrumbs and URL still look nice.