Bug 32012: runreport.pl should use binmode UTF-8
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 27 Oct 2022 09:15:35 +0000 (23:15 -1000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 2 Nov 2022 22:15:48 +0000 (19:15 -0300)
commit9aa21276b21693bdc60547ec532ec0595337df08
tree3984e2d7977881fd7f114ce3503676a7c638b54e
parent3aa50f045746b913e4dd1b0d6a1f6ea3cfbc8f63
Bug 32012: runreport.pl should use binmode UTF-8

Like Bug 26832 added binmode UTF-8 to script misc/search_tools/export_elasticsearch_mappings.pl, this should be added to misc/cronjobs/runreport.pl.

Test plan :
1) Do not apply patch
2) Create a SQL report with :
   SELECT 'accentué',barcode FROM items limit 3
3) Note the id of this report, for example 1
4) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/without.csv
=> You see output with unknown character instead of é :
5) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: iso-8859-1
6) Apply patch
7) Run : misc/cronjobs/runreport.pl 1 --format csv | tee /tmp/with.csv
=> You see correct output with é
8) Run : file --mime-type /tmp/without.csv
=> You see : /tmp/without.csv: utf-8

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
misc/cronjobs/runreport.pl