Bug 19756

Summary: Encoding issues when update DB is run from the interface
Product: Koha Reporter: Marc Véron <veron>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, jonathan.druart, kyle, liz, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 13793    
Bug Blocks:    
Attachments: Strange message while upgrading to 17.12.00.000
Bug 19756: Fix encoding issues during the update DB process
Bug 19756: Fix encoding issues during the update DB process
Bug 19756: Fix encoding issues during the update DB process

Description Marc Véron 2017-12-06 11:41:34 UTC
Created attachment 69552 [details]
Strange message while upgrading to 17.12.00.000

Upgrading to current master (17.12.00.0000) displays a strange message (seems to be encoding problem).
See screenshot from Firefox ESR 45.3.0
Comment 1 Liz Rea 2017-12-13 02:59:32 UTC
That will be some problem encoding the macrons in the update text.
Comment 2 Jonathan Druart 2017-12-20 21:59:23 UTC
(I am not sure about that I guess this has been added by bug 13793)
Comment 3 Jonathan Druart 2017-12-20 22:03:12 UTC
Created attachment 69980 [details] [review]
Bug 19756: Fix encoding issues during the update DB process

To display the output of the updatedatabase.pl under Plack, we redirect
the output to a temporary file, read it, then display it.
We need to open it specifying the correct encoding (utf-8).

Test plan:
1. MariaDB [koha_kohadev]> update systempreferences set value="17.1100000"
where variable="version";
2. restart plack
3. Login
4. Make the update from the interface
=> Without this patch you will see encoding issue:
Upgrade to 17.12.00.000 done (TÄ tÅia, tÄ haumatia)
=> With this patch applied you will see :
Upgrade to 17.12.00.000 done (Tē tōia, tē haumatia)
Comment 4 Liz Rea 2017-12-21 00:14:43 UTC
Created attachment 69983 [details] [review]
Bug 19756: Fix encoding issues during the update DB process

To display the output of the updatedatabase.pl under Plack, we redirect
the output to a temporary file, read it, then display it.
We need to open it specifying the correct encoding (utf-8).

Test plan:
1. MariaDB [koha_kohadev]> update systempreferences set value="17.1100000"
where variable="version";
2. restart plack
3. Login
4. Make the update from the interface
=> Without this patch you will see encoding issue:
Upgrade to 17.12.00.000 done (TÄ tÅia, tÄ haumatia)
=> With this patch applied you will see :
Upgrade to 17.12.00.000 done (Tē tōia, tē haumatia)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Comment 5 Kyle M Hall 2017-12-21 14:53:04 UTC
Created attachment 70040 [details] [review]
Bug 19756: Fix encoding issues during the update DB process

To display the output of the updatedatabase.pl under Plack, we redirect
the output to a temporary file, read it, then display it.
We need to open it specifying the correct encoding (utf-8).

Test plan:
1. MariaDB [koha_kohadev]> update systempreferences set value="17.1100000"
where variable="version";
2. restart plack
3. Login
4. Make the update from the interface
=> Without this patch you will see encoding issue:
Upgrade to 17.12.00.000 done (TÄ tÅia, tÄ haumatia)
=> With this patch applied you will see :
Upgrade to 17.12.00.000 done (Tē tōia, tē haumatia)

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Jonathan Druart 2017-12-21 16:24:54 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2018-01-15 16:42:46 UTC
Awesome work all, pushed to stable for 17.11.02
Comment 8 Fridolin Somers 2018-01-19 09:06:14 UTC
Pushed to 17.05.x for v17.05.08