Hi all

When sending a webform submission via email, if the subject contains accented characters (character é for instance), it is not passed as-is in the email subject field but is changed to é.
I tried using a hidden form field instead, but the result is exactly the same.

Is there some setting I have overlooked somewhere ?

Thanks !

Comments

codata created an issue.

Liam Morland’s picture

I am not seeing this problem on my server. This is probably caused by UTF-8 characters being interpreted as non-UTF-8. What happens when you send a similar email from your server but not through Drupal? By trying different combinations, you can narrow down where it is happening.

codata’s picture

Thanks for your comment Liam.

I only have administrator access to Drupal, I don't have direct access to the server.

Have you checked the source of the message ?
Thunderbird will actually "descramble" the badly encoded characters and display them just fine, but in the source you will see the scrambled characters.
The problem is worse with other mail-user-agents. Outlook will descramble the characters if the content-type header is Content-Type: text/plain; charset=utf-8. It will not descramble them if the content-type header is Content-Type: multipart/mixed; boundary="blablabla".
So depending on your mail-user-agent, you will see the subject line scrambled or not, but the source is wrongly encoded in all cases.

Excerpt from two emails, the first one displays fine in Outlook, the second doesn't, and as you can see both are badly encoded :

Original subject is Inscription à la réunion

Subject: Inscription à la réunion
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal Webform (PHP/5.5.38)
Subject: Inscription à la réunio
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="264352d6c7696484b46ce624dc5d5a6fac7cd4ea1"
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal Webform (PHP/5.5.38)
Liam Morland’s picture

I'm seeing the subject like this: =?UTF-8?B?Y2hhcmFjdGVyIMOpIGZvciBpbnN0YW5jZQ==?=.

codata’s picture

OK so you have proper UTF8 encoding !
That's exactly what I want, but not what I get.

I have :
Drupal 7.54
Webforms 7.x-4.14
Mime Mail 7.x-1.0-beta4+15-dev
Mail System 7.x-2.34+5-dev

Is there some setting (i18n ?) I need to activate somewhere to have the subject encoded in UTF8 ?

codata’s picture

I found this report that describes the same bug, but it is for PHPMailer which I don't use (I use Mail System) : https://www.drupal.org/node/1408226