If you have non-ASCII characters in the printed notice, and run it with --verbose or without --commit, you will get broken characters.
Created attachment 138502 [details] Screenshot
Created attachment 138504 [details] [review] Bug 31282: Fix broken characters in patron_emailer.pl verbose mode To test: 1. Have a report containing: SELECT tomascohen@theke.io; 2. Have a members notice containing ¡ and other non-ASCII characters. 3. Run (changing the report number and notice code accordingly): $ kshell k$ perl misc/cronjobs/patron_emailer.pl --report 4 \ --notice BIRTHDAY --from tomascohen@theke.io --module members => FAIL: non-ASCII characters are broken 4. Apply this patch 5. Repeat 3 => SUCCESS: Things print correctly! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 139439 [details] [review] Bug 31282: Fix broken characters in patron_emailer.pl verbose mode To test: 1. Have a report containing: SELECT tomascohen@theke.io; 2. Have a members notice containing ¡ and other non-ASCII characters. 3. Run (changing the report number and notice code accordingly): $ kshell k$ perl misc/cronjobs/patron_emailer.pl --report 4 \ --notice BIRTHDAY --from tomascohen@theke.io --module members => FAIL: non-ASCII characters are broken 4. Apply this patch 5. Repeat 3 => SUCCESS: Things print correctly! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using koha-testing-docker): - I couldn't get step 1 to work for me, so I ended up: . Creating a new report: SELECT borrowernumber, firstname, surname, address, email, address2, city, zipcode, dateofbirth FROM borrowers WHERE MONTH(dateofbirth) = 08 . Edited details of patrons in the results so that they have an email address. . Created a notice with a code called BIRTHDAY and added some text to the Email notice with non-ASCII characters. ==> step 3 worked as expected
Created attachment 139486 [details] [review] Bug 31282: Fix broken characters in patron_emailer.pl verbose mode To test: 1. Have a report containing: SELECT tomascohen@theke.io; 2. Have a members notice containing ¡ and other non-ASCII characters. 3. Run (changing the report number and notice code accordingly): $ kshell k$ perl misc/cronjobs/patron_emailer.pl --report 4 \ --notice BIRTHDAY --from tomascohen@theke.io --module members => FAIL: non-ASCII characters are broken 4. Apply this patch 5. Repeat 3 => SUCCESS: Things print correctly! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for 22.05.06 release
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.
Thanks! Pushed to 21.11 for 21.11.12