Browse Source

Bug 21874: Fix encoding of cart and list email subjects

The subject of the cart and list emails is not correctly
encoded and displays incorrectly in some email clients.

To test:

Lists:
- Create a list, name it using umlauts or other diacritics
  Example:  Jugendbücher (books for youths in German)
- Add some items to your list
- Email yourself the list
- Verify that the email subject is broken

Cart:
- Install another language with non-latin characters like Greek
- Fill the cart with some titles
- Send yourself the cart
- Verify that the email subject is broken

Note: Some email clients display correctly, others not.
      It's known to be incorrect in Outlook and web.de,
      displaying nicely in Thunderbird.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all four scripts by manipulating the cart text too in templates.
Follow-up handles intranet sendshelf.

Note: I asked Katrin to remove the encode UTF-8 statements, since we
convert to MIME and the subject line should never be UTF-8.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
18.11.x
Katrin Fischer 4 years ago
committed by Nick Clemens
parent
commit
e40bb00ab8
  1. 2
      basket/sendbasket.pl
  2. 2
      opac/opac-sendbasket.pl
  3. 2
      opac/opac-sendshelf.pl
  4. 2
      virtualshelves/sendshelf.pl

2
basket/sendbasket.pl

@ -112,7 +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});
$mail{subject} = encode('MIME-Header',$mail{subject});
}
else { $mail{'subject'} = "no subject"; }

2
opac/opac-sendbasket.pl

@ -133,7 +133,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});
$mail{subject} = encode('MIME-Header',$mail{subject});
}
else { $mail{'subject'} = "no subject"; }

2
opac/opac-sendshelf.pl

@ -136,7 +136,7 @@ if ( $email ) {
$mail{subject} =~ s|\n?(.*)\n?|$1|;
}
else { $mail{'subject'} = "no subject"; }
$mail{subject} = Encode::encode("UTF-8", $mail{subject});
$mail{subject} = encode('MIME-Header', $mail{subject});
my $email_header = "";
if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) {

2
virtualshelves/sendshelf.pl

@ -113,7 +113,7 @@ if ($email) {
# Analysing information and getting mail properties
if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) {
$mail{'subject'} = Encode::encode("UTF-8", $1);
$mail{'subject'} = encode('MIME-Header', $1);
$mail{subject} =~ s|\n?(.*)\n?|$1|;
}
else { $mail{'subject'} = "no subject"; }

Loading…
Cancel
Save