ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Mail header encoding problem with special characters (umlauts)

November 08, 2008 8:51am

Subscribe [2]
  • #1 / Nov 08, 2008 8:51am

    Erdal Demirtas

    84 posts

    Hi,
    I have a problem with the “subject” and “from” fields of the mails over communicate tab or through tell-a-friend form.

    EE-Version: ExpressionEngine 1.6.5, Build:  20081031

    CP Home ›  Admin ›  System Preferences ›  Email Configuration
    Email Character Encoding: utf-8
    Email Protocol: Sendmail

    My test mail via Communicate Tab (HTML):
    Name: Erdal ä ö ü - ae ou ue
    Subject: ä ö ü - ae ou ue
    Message: Testing ä ö ü - ae ou ue

    Only google mail shows the “from” and “subject” of the mail correctly.
    The message body is allways OK.

    It is as if the utf-8 encoded strings are shown as iso-8859-1.

    I can send the same mail to a real email, if you want to see the mail header.

    Here are the results:
    From: Erdal ä ö ü - ae ou ue
    Subject: ä ö ü - ae ou ue
    Message: Testing ä ö ü - ae ou ue

  • #2 / Nov 08, 2008 11:26am

    Ingmar

    29245 posts

    The body is displaying correctly, yes? The problem is that headers, by definition, must by 7bit ASCII. You can define which encoding to use in the body (using another header), but for high ASCII characters in another header, you need to use quoted printable. I am not sure if Hotmail can actually make use of that.

    That said, go ahead, send me a test email to .(JavaScript must be enabled to view this email address) (Ingmar Greil) so I can see the headers for myself.

  • #3 / Nov 08, 2008 12:22pm

    Erdal Demirtas

    84 posts

    Yes, the body is displayed correctly.

    I sent you a mail so that you can see the header.

    I read about the 7-bit issue.

    I hope this problem can be solved without hacking core.email.php

    Thanks

  • #4 / Nov 10, 2008 10:48am

    Ingmar

    29245 posts

    Erdal, further testing revealed that this is indeed an area where EE can be improved. This will be fixed in one of the next build updates to EE 1.6.5.

  • #5 / Nov 10, 2008 4:21pm

    Erdal Demirtas

    84 posts

    Thank you for the answer.
    It was clear to me that something should be done in EE-core.

    This helped me a little bit:

    core.email.php ->

    only for german characters (äöüß):

    function from($from, $name = '')
    {
    ...
    $name = mb_convert_encoding ($name, "ISO-8859-1", "UTF-8");
    ...
    }

    for german and turkish characters (öäüß çışğ):

    function from($from, $name = '')
    {
    ...
    $name = mb_convert_encoding ($name, "ISO-8859-9", "UTF-8");
    ...
    }

    I will use this until it is fixed.

  • #6 / Nov 10, 2008 4:30pm

    Ingmar

    29245 posts

    Erdal, I do not immediately see how you benefit from bringing the Latin-5 charset into play? The correct solution would be to use quoted-printable on the headers. As I’ve said, this will be fixed in an upcoming build.

  • #7 / Nov 10, 2008 4:40pm

    Erdal Demirtas

    84 posts

    You saw the results of my first post, they are not readable.
    Doing this produces readable ones (name field).

  • #8 / Nov 10, 2008 4:45pm

    Ingmar

    29245 posts

    Whatever works for you, I guess… Please do not hesitate to post again if needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases