Bug 28094 - Fix bad encoding of OVERRIDE_SYSPREF_LibraryName
Summary: Fix bad encoding of OVERRIDE_SYSPREF_LibraryName
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-06 11:47 UTC by Magnus Enger
Modified: 2021-12-13 21:10 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 28094: Deal with encoding for overriden sysprefs (1.21 KB, patch)
2021-04-06 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 28094: Deal with encoding for overriden sysprefs (1.26 KB, patch)
2021-04-06 20:38 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 28094: Deal with encoding for overriden sysprefs (1.32 KB, patch)
2021-04-09 10:24 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2021-04-06 11:47:55 UTC
I am creating alternative OPACs for a Koha site using the SetEnv techniques. When I set this in the Apache config:

  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Slægtsforskernes Bibliotek"

there is a problem with the encoding, the name is displayed like this:

  Slægtsforskernes Bibliotek

If I try to replace the "æ" with æ, that text is displayed as is, and not replaced by the proper letter:

  Slægtsforskernes Bibliotek

Anyone got a clue how to fix this?
Comment 1 Jonathan Druart 2021-04-06 14:29:20 UTC
Created attachment 119221 [details] [review]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty
Comment 2 Lucas Gass 2021-04-06 20:38:53 UTC
Created attachment 119245 [details] [review]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Julian Maurice 2021-04-09 10:24:02 UTC
Created attachment 119369 [details] [review]
Bug 28094: Deal with encoding for overriden sysprefs

The string we retrieved is UTF-8 encoded, to prevent encoding issue we
must decode it first.

Test plan:
Easily testable with LibraryName:
1. edit /etc/apache2/sites-available/kohadev.conf
2. Add
  RequestHeader add X-Koha-SetEnv "OVERRIDE_SYSPREF_LibraryName Library of ❤️"
3. restart_all
4. Hit the mainpage and look at the source (or title) and confirm that
the string is displayed correcty

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Jonathan Druart 2021-04-09 14:41:23 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 5 Magnus Enger 2021-04-12 08:05:57 UTC
Wow, thanks for fixing this so quickley!
Comment 6 Fridolin Somers 2021-04-19 10:17:15 UTC
Pushed to 20.11.x for 20.11.05
Comment 7 Andrew Fuerste-Henry 2021-04-25 14:26:02 UTC
Pushed to 20.05.x for 20.05.11
Comment 8 Victor Grousset/tuxayo 2021-04-25 17:20:00 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.