Cronjob runreport.pl runs SQL reports and can export as CSV. This export needs to be UTF-8 encoded.
Created attachment 85061 [details] [review] Bug 22323: cronjob runreport.pl CSV add encoding Cronjob runreport.pl runs SQL reports and can export as CSV. This export needs to be UTF-8 encoded. This pathes replaces use of Text::CSV_XS by Text::CSV::Encoded like in other places like tools/viewlog.pl. It adds a decode of headers bcause they will be encoded lika other lines. Test plan: 1) Create a new item with itemnotes 'accentué' 2) Create a SQL report with : SELECT barcode,itemnotes AS itè FROM items WHERE itemnotes LIKE 'accenté' 3) Run this report 4) You see well encoded header and content 5) Run from command line (replace X by report number) : misc/cronjobs/runreport.pl X --format=csv --csv-header --store-results 6) You well encoded header and content 7) Go to saved reports table 8) Look at saved results of report 9) You well encoded header and content
Created attachment 85189 [details] [review] Bug 22323: cronjob runreport.pl CSV add encoding Cronjob runreport.pl runs SQL reports and can export as CSV. This export needs to be UTF-8 encoded. This pathes replaces use of Text::CSV_XS by Text::CSV::Encoded like in other places like tools/viewlog.pl. It adds a decode of headers bcause they will be encoded lika other lines. Test plan: 1) Create a new item with itemnotes 'accentué' 2) Create a SQL report with : SELECT barcode,itemnotes AS itè FROM items WHERE itemnotes LIKE 'accenté' 3) Run this report 4) You see well encoded header and content 5) Run from command line (replace X by report number) : misc/cronjobs/runreport.pl X --format=csv --csv-header --store-results 6) You well encoded header and content 7) Go to saved reports table 8) Look at saved results of report 9) You well encoded header and content Signed-off-by: Mikaël Olangcay Brisebois <mikael.olangcay-brisebois@inLibro.com>
Created attachment 85220 [details] [review] Bug 22323: cronjob runreport.pl CSV add encoding Cronjob runreport.pl runs SQL reports and can export as CSV. This export needs to be UTF-8 encoded. This pathes replaces use of Text::CSV_XS by Text::CSV::Encoded like in other places like tools/viewlog.pl. It adds a decode of headers bcause they will be encoded lika other lines. Test plan: 1) Create a new item with itemnotes 'accentué' 2) Create a SQL report with : SELECT barcode,itemnotes AS itè FROM items WHERE itemnotes LIKE 'accenté' 3) Run this report 4) You see well encoded header and content 5) Run from command line (replace X by report number) : misc/cronjobs/runreport.pl X --format=csv --csv-header --store-results 6) You well encoded header and content 7) Go to saved reports table 8) Look at saved results of report 9) You well encoded header and content Signed-off-by: Mikaël Olangcay Brisebois <mikael.olangcay-brisebois@inLibro.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.04
backported to 18.05.x for 18.05.11
Pushed to 17.11.x for 17.11.17