Bug 26601 - Add utf8 output to text output of overdue_notices.pl
Summary: Add utf8 output to text output of overdue_notices.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Mark Hofstetter
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-02 08:35 UTC by Mark Hofstetter
Modified: 2021-06-14 21:31 UTC (History)
7 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.06, 19.11.12, 19.05.17
Circulation function:


Attachments
0001-Bug-26601-add-utf8-output-to-text-output-of-overdue_.patch (1.22 KB, patch)
2020-10-19 18:37 UTC, Mark Hofstetter
Details | Diff | Splinter Review
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl (1.30 KB, patch)
2020-10-21 16:05 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl (1.66 KB, patch)
2020-10-22 00:58 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hofstetter 2020-10-02 08:35:03 UTC
misc/cronjobs/overdue_notices.pl

-text option does not use utf8 to print/output the texts - this renders german umlauts unreadable
Comment 1 Mark Hofstetter 2020-10-19 18:37:42 UTC
Created attachment 112006 [details] [review]
0001-Bug-26601-add-utf8-output-to-text-output-of-overdue_.patch

also a test on howto submit koha patches
Comment 2 Katrin Fischer 2020-10-19 18:53:38 UTC
Hi Mark, 

this already looks good! Some small things: 
- the subject line should always start with Bug XXXX: description of fix
- a description of the problem should be included 
- and a step by step test plan

Finally, once a patch is uploaded, make sure to switch the status to "Needs Signoff" as this will be the queue/search testers are looking at.
Comment 3 Mark Hofstetter 2020-10-21 06:14:49 UTC
Hi,

thanks for the feedback - do you mean the subject line of the patch I guess - or some other?


Subject: [PATCH] Bug [26601]: [add utf8 output to text output of
 overdue_notices.pl]

Shall I change anything now or is it OK for this one - I'll try to improve next time
Comment 4 Martin Renvoize (ashimema) 2020-10-21 16:05:30 UTC
Created attachment 112112 [details] [review]
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl

This patch sets the UTF8 encoding for output of overdue_notices.pl when
outputting to txt.

To test:
1/ Create ODUE text with a utf8 encoded characher, eg german umlauts
   <url>/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation&code=ODUE
2/ Run
   perl overdue_notices.pl -text [-library <library-name>] -test
3/ Confirm text now inludes properly encoded umlauts

Sponsored-by: Styrian State Library
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize (ashimema) 2020-10-21 16:06:43 UTC
This works great, thanks Mark.

I've signed off and updated the commit message to adhere to current guidelines for you.. now Katrin to finish the process by QAing :)

Great to have you aboard.
Comment 6 Katrin Fischer 2020-10-22 00:58:11 UTC
Created attachment 112124 [details] [review]
Bug 26601: Add utf8 encoding to text output of overdue_notices.pl

This patch sets the UTF8 encoding for output of overdue_notices.pl when
outputting to txt.

To test:
0/ Check out an item with due date yesterday (use specify due date)
1/ Create ODUE text with utf8 encoded characters, chinese characters, umlauts etc
   <url>/cgi-bin/koha/tools/letter.pl?op=add_form&module=circulation&code=ODUE
2/ Run
   perl overdue_notices.pl -text ./
3/ Verify encoding in the generated text file is incorrect
4/ Apply patch and repeat 2/
3/ Confirm text now inludes properly encoded characters

Sponsored-by: Styrian State Library
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
With German umlauts on my system the editor still showed the
characters correctly (probably guessing the right encoding).
Using Chinese made the problem visible.
Comment 7 Katrin Fischer 2020-10-22 01:05:49 UTC
Fleshed out the test plan a little bit more and also tested the csv option that appears to work correctly.
Comment 8 Jonathan Druart 2020-10-25 23:07:12 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Jonathan Druart 2020-10-25 23:17:48 UTC
Congratulations Mark for your first patch pushed!
Comment 10 Lucas Gass (lukeg) 2020-11-13 20:29:14 UTC
backported to 20.05.x for 20.05.06
Comment 11 Aleisha Amohia 2020-11-17 04:40:16 UTC
backported to 19.11.x for 19.11.12
Comment 12 Victor Grousset/tuxayo 2020-11-17 11:56:02 UTC
Backported to 19.05.x branch for 19.05.17