Bug 11515

Summary: Encoding problem with OpacBrowseResults
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: OPACAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: boutrosboutrosboutros, kyle, m.de.rooy, sandboxes, tomascohen
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:
Circulation function:
Bug Depends on: 6483    
Bug Blocks: 22070    
Attachments: Bug 11515 - Encoding problem with OpacBrowseResults
Bug 11515 - Encoding problem with OpacBrowseResults
Bug 11515 - Encoding problem with OpacBrowseResults
Bug 11515 - Encoding problem with OpacBrowseResults

Description Fridolin Somers 2014-01-10 10:51:37 UTC
When OpacBrowseResults syspref is on, the detail page contains a results browser.
When search therm contains non-ASCII character, the search query is not well encoded in this browser.
Comment 1 Fridolin Somers 2014-01-10 11:18:05 UTC Comment hidden (obsolete)
Comment 2 Petter Goksøyr Åsen 2014-01-30 13:55:43 UTC
I don't experience this encoding issue, using queries with Norwegian characters or French diactric marks. The query is always correctly displayed. It's also displayed correctly after I apply the patch..
Comment 3 Fridolin Somers 2014-01-30 14:13:13 UTC
(In reply to Petter Goksøyr Åsen from comment #2)
> I don't experience this encoding issue, using queries with Norwegian
> characters or French diactric marks. The query is always correctly
> displayed. It's also displayed correctly after I apply the patch..
Odd.
When I test on master :
- simple search at OPAC with "centré"
- I have 5 results
- I click on a result
- I click on "Back to results"
=> I get the page : "cgi-bin/koha/opac-search.pl?idx=&q=centré", "centré" in search box and no results.
Comment 4 Petter Goksøyr Åsen 2014-01-30 14:26:45 UTC
> Odd.
> When I test on master :
> - simple search at OPAC with "centré"
> - I have 5 results
> - I click on a result
> - I click on "Back to results"
> => I get the page : "cgi-bin/koha/opac-search.pl?idx=&q=centré", "centré" in  search box and no results.

Hm, I'm on master too. When I search for "øl", get 22 results, click on a result, click "Back to results", I get the page:
=> http://localhost:9000/cgi-bin/koha/opac-search.pl?q=%C3%B8l
"øl" beeing url-encoded into %C3%B8l
Its displayed correctly in the browser:
=> Results of search for 'kw,wrdl: øl'

I notice you have idx= in your url, why I dont have that?

I am very interested in any encoding-related bugs, because we also experience them on a seemingly random basis.

It seems to me that it is not dealt with properly once and for all in Koha (ie. force utf-8 everywhere), but instead patched here and there, with the result that we sometimes get double-encoding issues. However, I do not know enough about Perl or Koha yet, so I might be totally wrong
Comment 5 Marcel de Rooy 2014-01-30 14:31:47 UTC
(In reply to Petter Goksøyr Åsen from comment #4)
> It seems to me that it is not dealt with properly once and for all in Koha
> (ie. force utf-8 everywhere), but instead patched here and there, with the
> result that we sometimes get double-encoding issues. However, I do not know
> enough about Perl or Koha yet, so I might be totally wrong

Well, this sounds (unfortunately) quite correct to me :)
Comment 6 Fridolin Somers 2014-01-30 15:10:53 UTC
(In reply to Petter Goksøyr Åsen from comment #4)
> I notice you have idx= in your url, why I dont have that?
I've tested with "øl". It works.
Can you test with one of ê,é,è,à,â,ù ?
Comment 7 Fridolin Somers 2014-01-30 15:11:53 UTC
> I've tested with "øl". It works.
I mean this patch is not needed for "øl".
Comment 8 Petter Goksøyr Åsen 2014-01-30 15:55:59 UTC
> Can you test with one of ê,é,è,à,â,ù ?

I did also try with french characters,
It also works:
=> Results of search for 'kw,wrdl: andré'
   http://localhost:9000/cgi-bin/koha/opac-search.pl?q=andr%C3%A9

Same with à, ė & ê

Can it be that your OS/browser submits the querystring with a French encoding?
Comment 9 Fridolin Somers 2014-02-10 08:06:55 UTC
Without patch, when searching "centré", I get in "Back to results" : opac-search.pl?idx=&q=centr%C3%83%C2%A9
My locale is "fr-FR.UTF-8".
Seems this bug exists only since 3.14. Can you test on a fresh install ?
Comment 10 Petter Goksøyr Åsen 2014-02-10 12:06:19 UTC
> Seems this bug exists only since 3.14. Can you test on a fresh install ?

By fresh install, do you mean the debian package? And not from git master?
Comment 11 Fridolin Somers 2014-02-10 12:30:15 UTC
(In reply to Petter Goksøyr Åsen from comment #10)
> > Seems this bug exists only since 3.14. Can you test on a fresh install ?
> 
> By fresh install, do you mean the debian package? And not from git master?
No, I mean an install created from scratch, not an existing install with sources updated to current master.

If someone else could test, it would be great.
Comment 12 Biblibre Sandboxes 2014-03-10 15:57:09 UTC
Patch tested with a sandbox, by Broust <jean-manuel.broust@univ-lyon2.fr>
Comment 13 Biblibre Sandboxes 2014-03-10 15:57:28 UTC Comment hidden (obsolete)
Comment 14 Katrin Fischer 2014-04-18 12:04:02 UTC
Fridolin, could you check this is still valid on current master? Also... patch doesn't apply.
Comment 15 Fridolin Somers 2014-10-08 13:05:30 UTC Comment hidden (obsolete)
Comment 16 Fridolin Somers 2014-10-08 13:13:18 UTC
(In reply to Katrin Fischer from comment #14)
> Fridolin, could you check this is still valid on current master?
Still exists withe actual test plan.

> Also... patch doesn't apply.
Patch rebased.
Comment 17 Kyle M Hall (khall) 2014-10-31 15:44:00 UTC
Created attachment 33084 [details] [review]
Bug 11515 - Encoding problem with OpacBrowseResults
Comment 18 Kyle M Hall (khall) 2014-10-31 15:45:58 UTC
Works well. I do wonder if this is the level to solve this at, but it works!
Comment 19 Tomás Cohen Arazi (tcohen) 2014-11-21 19:03:55 UTC
Patch pushed to master.

Thanks Frido!