Bugzilla – Attachment 35239 Details for
Bug 11944
Cleanup Koha UTF-8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11944: Fix encoding on sending emails
Bug-11944-Fix-encoding-on-sending-emails.patch (text/plain), 5.53 KB, created by
Jonathan Druart
on 2015-01-14 15:44:05 UTC
(
hide
)
Description:
Bug 11944: Fix encoding on sending emails
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-01-14 15:44:05 UTC
Size:
5.53 KB
patch
obsolete
>From 3291c8b130e841f017e1dc55178590f67ca61e77 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 14 Apr 2014 16:33:56 +0200 >Subject: [PATCH] Bug 11944: Fix encoding on sending emails > >This patch fixes 2 places where mails were badly encoded: >1/ At the opac and the intranet, on sending baskets >2/ At the opac and the intranet, on sending shelf/list > >Test plan: >Shelf/List: >- Create a list with non-latin characters in the name. >- Add some items containing non-latin characters in their content. >- Send the list by email > >Basket/Cart: >- Add some items containing non-latin characters in their content to > your cart.. >- Send the cart by email > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org> > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > basket/sendbasket.pl | 5 +++-- > opac/opac-sendbasket.pl | 5 +++-- > opac/opac-sendshelf.pl | 5 +++-- > virtualshelves/sendshelf.pl | 8 ++++---- > 4 files changed, 13 insertions(+), 10 deletions(-) > >diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl >index 36f3c1a..df8d358 100755 >--- a/basket/sendbasket.pl >+++ b/basket/sendbasket.pl >@@ -112,6 +112,7 @@ if ( $email_add ) { > if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) { > $mail{subject} = $1; > $mail{subject} =~ s|\n?(.*)\n?|$1|; >+ $mail{subject} = Encode::encode("UTF-8", $mail{subject}); > } > else { $mail{'subject'} = "no subject"; } > >@@ -119,7 +120,7 @@ if ( $email_add ) { > if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { > $email_header = $1; > $email_header =~ s|\n?(.*)\n?|$1|; >- $email_header = encode_qp($email_header); >+ $email_header = encode_qp(Encode::encode("UTF-8", $email_header)); > } > > my $email_file = "basket.txt"; >@@ -131,7 +132,7 @@ if ( $email_add ) { > if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { > $body = $1; > $body =~ s|\n?(.*)\n?|$1|; >- $body = encode_qp($body); >+ $body = encode_qp(Encode::encode("UTF-8", $body)); > } > > my $boundary = "====" . time() . "===="; >diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index 7b63ee2..1dac954 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -131,6 +131,7 @@ if ( $email_add ) { > if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) { > $mail{subject} = $1; > $mail{subject} =~ s|\n?(.*)\n?|$1|; >+ $mail{subject} = Encode::encode("UTF-8", $mail{subject}); > } > else { $mail{'subject'} = "no subject"; } > >@@ -138,7 +139,7 @@ if ( $email_add ) { > if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { > $email_header = $1; > $email_header =~ s|\n?(.*)\n?|$1|; >- $email_header = encode_qp($email_header); >+ $email_header = encode_qp(Encode::encode("UTF-8", $email_header)); > } > > my $email_file = "basket.txt"; >@@ -150,7 +151,7 @@ if ( $email_add ) { > if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { > $body = $1; > $body =~ s|\n?(.*)\n?|$1|; >- $body = encode_qp($body); >+ $body = encode_qp(Encode::encode("UTF-8", $body)); > } > > $mail{body} = $body; >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index 61cc979..7856380 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -128,12 +128,13 @@ if ( $email ) { > $mail{subject} =~ s|\n?(.*)\n?|$1|; > } > else { $mail{'subject'} = "no subject"; } >+ $mail{subject} = Encode::encode("UTF-8", $mail{subject}); > > my $email_header = ""; > if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { > $email_header = $1; > $email_header =~ s|\n?(.*)\n?|$1|; >- $email_header = encode_qp($email_header); >+ $email_header = encode_qp(Encode::encode("UTF-8", $email_header)); > } > > my $email_file = "list.txt"; >@@ -145,7 +146,7 @@ if ( $email ) { > if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { > $body = $1; > $body =~ s|\n?(.*)\n?|$1|; >- $body = encode_qp($body); >+ $body = encode_qp(Encode::encode("UTF-8", $body)); > } > > my $boundary = "====" . time() . "===="; >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index c98e8ce..4649aa3 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -21,7 +21,7 @@ use strict; > use warnings; > > use CGI qw ( -utf8 ); >-use Encode qw(encode); >+use Encode qw( encode ); > use Carp; > > use Mail::Sendmail; >@@ -119,7 +119,7 @@ if ($email) { > > # Analysing information and getting mail properties > if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) { >- $mail{subject} = $1; >+ $mail{'subject'} = Encode::encode("UTF-8", $1); > $mail{subject} =~ s|\n?(.*)\n?|$1|; > } > else { $mail{'subject'} = "no subject"; } >@@ -128,7 +128,7 @@ if ($email) { > if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { > $email_header = $1; > $email_header =~ s|\n?(.*)\n?|$1|; >- $email_header = encode_qp($email_header); >+ $email_header = encode_qp(Encode::encode("UTF-8", $email_header)); > } > > my $email_file = "list.txt"; >@@ -140,7 +140,7 @@ if ($email) { > if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { > $body = $1; > $body =~ s|\n?(.*)\n?|$1|; >- $body = encode_qp($body); >+ $body = encode_qp(Encode::encode("UTF-8", $body)); > } > > my $boundary = "====" . time() . "===="; >-- >2.1.0
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 11944
:
26364
|
26365
|
26366
|
26367
|
26368
|
26369
|
26370
|
26371
|
26372
|
26407
|
26408
|
26409
|
26737
|
26738
|
26739
|
26740
|
26741
|
26742
|
26743
|
26744
|
26745
|
26746
|
26747
|
26748
|
26794
|
26857
|
26858
|
26859
|
26860
|
26861
|
26862
|
26863
|
26864
|
26865
|
26866
|
26867
|
26868
|
26869
|
26870
|
26871
|
26895
|
26921
|
27021
|
27080
|
27094
|
27158
|
27159
|
27161
|
27193
|
27194
|
27195
|
27196
|
27198
|
27199
|
27200
|
27201
|
27202
|
27203
|
27204
|
27205
|
27206
|
27207
|
27208
|
27209
|
27210
|
27211
|
27212
|
27213
|
27214
|
27215
|
27216
|
27585
|
27586
|
27587
|
27588
|
27589
|
27590
|
27591
|
27592
|
27593
|
27594
|
27595
|
27596
|
27597
|
27598
|
27599
|
27600
|
27601
|
27602
|
27603
|
27880
|
27881
|
27882
|
27883
|
27884
|
27885
|
27886
|
27887
|
27888
|
27889
|
27890
|
27891
|
27892
|
27893
|
27894
|
27895
|
27896
|
27897
|
27898
|
28046
|
28047
|
28048
|
28049
|
28050
|
28051
|
28052
|
28053
|
28054
|
28055
|
28056
|
28057
|
28058
|
28059
|
28060
|
28061
|
28062
|
28063
|
28064
|
28065
|
28066
|
28097
|
28245
|
28246
|
28247
|
28248
|
28249
|
28250
|
28251
|
28252
|
28253
|
28732
|
29981
|
29982
|
29983
|
29984
|
29985
|
29986
|
29987
|
29988
|
29989
|
29990
|
29991
|
29992
|
29993
|
29994
|
29995
|
29996
|
29997
|
29998
|
29999
|
30000
|
30001
|
30002
|
30003
|
30004
|
30005
|
30006
|
30012
|
30016
|
30945
|
31299
|
35223
|
35224
|
35225
|
35226
|
35227
|
35228
|
35229
|
35230
|
35231
|
35232
|
35233
|
35234
|
35235
|
35236
|
35237
|
35238
| 35239 |
35240
|
35241
|
35242
|
35243
|
35244
|
35245
|
35246
|
35247
|
35248
|
35249
|
35250
|
35251
|
35252
|
35253