Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an error with character encoding in sender name. I got this as sender name,
MNM RC3A9gC3A9szeti AdatbC3A1zis
but it's not correct. Here is the right one,
MNM Régészeti Adatbázis
.
http://www.fileformat.info/info/unicode/char/00e9/index.htm
I attached a screenshot as well.
Comment | File | Size | Author |
---|---|---|---|
#7 | smtp-headers-enconding-2755027-7.patch | 2.64 KB | recidive |
#5 | wrong_character_encoding_in_sender_name-2755027-5.patch | 910 bytes | jjcarrion |
| |||
Screen Shot 2016-06-24 at 13.20.27.png | 10.62 KB | asrob |
Comments
Comment #2
Ramdas Gaikar CreditAttribution: Ramdas Gaikar at Intelliswift commentedI can see the default encoding set in PHPMailer.php file is as below :
/**
* Sets the Encoding of the message. Options for this are
* "8bit", "7bit", "binary", "base64", and "quoted-printable".
* @var string
*/
public $Encoding = '8bit';
Also I can see the below function does the Encoding of Header including From Name.
public function EncodeHeader($str, $position = 'text');
So someone who can dig little more, will get the issue.
Comment #3
artem0793 CreditAttribution: artem0793 commentedComment #4
asermc CreditAttribution: asermc commentedHi!
Do you have a way or idea to resolve this problem?
thanks a lot
Comment #5
jjcarrionI have the same problem with Swedish characters, but I have it in the subject as well.
I have tried different things:
hook_mail_alter:
With this, the subject was fixed but I couldn't change the From at all.
Changing the CharSet in PHPMailer
I did something like $mailer->CharSet = 'utf-8'; but it didn't work.
So, finally I did what I have in the patch and that solved my problem but I don't think that this is a general solution.
If we could change the PHPMailer Charset, maybe we could create a setting for that so the user could set the CharSet that they need for their project. Any ideas on this?
Comment #6
petergus CreditAttribution: petergus commentedI ended up using the patch at https://www.drupal.org/node/2865880 because this didn't really work, especially for the Reply-to name.
Did you find any other solution yet?
Comment #7
recidive CreditAttribution: recidive commentedAttached is a patch that uses the
Unicode::mimeHeaderEncode()
instead oficonv_mime_encode()
. And apply the encoding to From, ReplyTo, CC, BCC and Subject.Comment #8
artem0793 CreditAttribution: artem0793 commentedComment #9
swentel CreditAttribution: swentel as a volunteer commentedThe Unicode::mimeHeaderEncode() seems logical, especially since PhpMail does this as well!
Comment #10
hanness#7 worked fine for us. tested with subject and from.
Comment #11
C-LogemannSuccessfully tested patch #7 and added to patch management of two productive websites. So +1 for RTBC
Comment #12
keopx+1 for RTBC
Comment #13
fall_0ut CreditAttribution: fall_0ut at Openquest commentedTested with patch #7, works fine
Comment #14
Ismail Cherri CreditAttribution: Ismail Cherri as a volunteer and commentedTest patch #7 and it is working fine.
Comment #15
mgstablesTested patch #7 and it is working
Comment #16
wundo CreditAttribution: wundo at Chuva Inc. commentedComment #18
wundo CreditAttribution: wundo at Chuva Inc. commented