Bugzilla – Attachment 77992 Details for
Bug 21142
Batch item/record modification/deletion tools does not open uploaded files in utf-8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21142: Open uploaded files in utf-8 - batch mod/del
Bug-21142-Open-uploaded-files-in-utf-8---batch-mod.patch (text/plain), 2.29 KB, created by
Owen Leonard
on 2018-08-17 17:13:54 UTC
(
hide
)
Description:
Bug 21142: Open uploaded files in utf-8 - batch mod/del
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-08-17 17:13:54 UTC
Size:
2.29 KB
patch
obsolete
>From 34b585b7e162e2c6bece9d176dfc6f27bb8e24ac Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 17 Aug 2018 12:07:55 -0300 >Subject: [PATCH] Bug 21142: Open uploaded files in utf-8 - batch mod/del >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Batch item/record modification/deletion tools does not open uploaded >files in utf-8 > >Test plan: >Edit and delete records and items using a file which will contain: >valid and invalid barcodes with and without utf-8 chars (ð) > >You should see the warning message: > "The *** 39999000ð001679 does not exist in the database." > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > tools/batchMod.pl | 1 + > tools/batch_delete_records.pl | 1 + > tools/batch_record_modification.pl | 1 + > 3 files changed, 3 insertions(+) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 0e985a2..503f5ce 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -237,6 +237,7 @@ if ($op eq "show"){ > > my @contentlist; > if ($filefh){ >+ binmode $filefh, ':encoding(UTF-8)'; > while (my $content=<$filefh>){ > $content =~ s/[\r\n]*$//; > push @contentlist, $content if $content; >diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl >index 8804e62..149b44d 100755 >--- a/tools/batch_delete_records.pl >+++ b/tools/batch_delete_records.pl >@@ -57,6 +57,7 @@ if ( $op eq 'form' ) { > $recordtype = 'biblio'; > } elsif ( my $uploadfile = $input->param('uploadfile') ) { > # A file of id is given >+ binmode $uploadfile, ':encoding(UTF-8)'; > while ( my $content = <$uploadfile> ) { > next unless $content; > $content =~ s/[\r\n]*$//; >diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl >index bfdb758..2b76084 100755 >--- a/tools/batch_record_modification.pl >+++ b/tools/batch_record_modification.pl >@@ -105,6 +105,7 @@ if ( $op eq 'form' ) { > $recordtype = 'biblio'; > } elsif ( my $uploadfile = $input->param('uploadfile') ) { > # A file of id is given >+ binmode $uploadfile, ':encoding(UTF-8)'; > while ( my $content = <$uploadfile> ) { > next unless $content; > $content =~ s/[\r\n]*$//; >-- >2.1.4
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 21142
:
77406
|
77407
|
77986
|
77992
|
78015