Bugzilla – Attachment 177507 Details for
Bug 39023
Add utf8 output to CSV output of overdue_notices.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add utf8 encoding for csv file output
0001-Bug-39023-Fix-encoding-in-CSV-output-file.patch (text/plain), 2.07 KB, created by
davewood
on 2025-02-04 13:24:26 UTC
(
hide
)
Description:
add utf8 encoding for csv file output
Filename:
MIME Type:
Creator:
davewood
Created:
2025-02-04 13:24:26 UTC
Size:
2.07 KB
patch
obsolete
>From d263fe96ddc88278771f90914595f35891c3da56 Mon Sep 17 00:00:00 2001 >From: David Schmidt <mail@davidschmidt.at> >Date: Tue, 4 Feb 2025 11:48:07 +0100 >Subject: [PATCH] Bug 39023: Fix encoding in CSV output file >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Sponsored-by: Styrian State Library > >Testplan: > >I) Prepare overdue entry (intranet): >0) Create a patron account with surname Höfler >1) Check if in Patron category administration the overdue column > is YES for his code >2) In Tools -> Notice triggers define first delay = 7, letter > Overdue notice. Nothing for second and third >3) Check if Tools -> Notices and slips, code overdue is available >4) checkout a book with a retard more than 7 days. >5) Check if Adminstration -> Defining circulation and fine rules > for all libraries has fine rules for his patron category, > item type book. > >II) Before applying the patch >0) Run misc/cronjobs/overdue_notices.pl -v -test -list-all -csv="overdue_old.csv" >1) Validate the characters are in Latin1 encoding. > (hexdump -C overdue.csv|less) ö => "f6" > >III) After applying the patch >0) Run misc/cronjobs/overdue_notices.pl -v -test -list-all -csv="overdue_fixed.csv" >1) Validate the characters are in UTF-8 encoding. > (hexdump -C overdue_fixed.csv|less) ö => "c3 b6 >--- > misc/cronjobs/overdue_notices.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index 3a70377..27de141 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -419,7 +419,7 @@ if ( defined $csvfilename ) { > if ( $csvfilename eq '' ) { > $csv_fh = *STDOUT; > } else { >- open $csv_fh, ">", $csvfilename or die "unable to open $csvfilename: $!"; >+ open $csv_fh, ">:encoding(UTF-8)", $csvfilename or die "unable to open $csvfilename: $!"; > } > if ( $csv->combine(qw(name surname address1 address2 zipcode city country email phone cardnumber itemcount itemsinfo branchname letternumber)) ) { > print $csv_fh $csv->string, "\n"; >-- >2.39.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39023
:
177496
| 177507