+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 38

Thread: Solution for Encoding From Header in utf-8

  1. #1
    Join Date
    Jun 2006
    Posts
    3

    Default Solution for Encoding From Header in utf-8

    my site is utf-8 encoded and formmal is using an HTML templates which is also utf-8 encoded. everything was great except the From Header was not utf-8 encoded and names written in utf-8 encoded arabic characters would come up as garbled text in Outlook.

    to fix this, and have the name in From Header utf-8 encoded, change this, starting around line 7666:

    PHP Code:
    function MakeFromLine($s_email,$s_name)
    {
        
    $s_line "";
        if (!empty(
    $s_email))
            
    $s_line .= $s_email." ";
        if (!empty(
    $s_name))
            
    $s_line .= "(".$s_name.")";
        return (
    $s_line);

    to this:

    PHP Code:
    function MakeFromLine($s_email,$s_name)
    {
        
    $s_line "";
        if (!empty(
    $s_email))
            
    $s_line .= $s_email." ";
        if (!empty(
    $s_name))
            
    $s_line .= "(=?utf-8?B?".base64_encode($s_name)."?=)";
        return (
    $s_line);


    this is based on formmail.php version 8.02 hope it helps someone.

    and thanks again Russell for the truly awesome script.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Solution for Encoding From Header in utf-8

    Hi,

    Thanks for the tip.

    We'll try to get this into the standard code for the next release.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Solution for Encoding From Header in utf-8

    Hi,

    Update on this....

    I want to implement a generic solution for all headers.

    It needs also to be tied to the Language Packs, so UTF-8 alone is probably not good enough.

    It's on the TO DO list.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Jun 2006
    Posts
    3

    Default Re: Solution for Encoding From Header in utf-8

    hi,

    if you need any help testing, please let me know.

  5. #5
    Join Date
    May 2009
    Posts
    32

    Default Re: Solution for Encoding From Header in utf-8

    Quote Originally Posted by pulp View Post
    hi,

    if you need any help testing, please let me know.
    This fix worked very well for me with FormMail 8.14. I upgraded to version 8.15 but it have many changes in this area. If you could have a look at this again it would be very much appreciated.

  6. #6
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Solution for Encoding From Header in utf-8

    Hi,

    We've now created a complete solution for international characters in email headers.

    The problem is it's another 1000 lines of PHP code!

    Because of the size, we're not that keen to add all that code into FormMail.

    Instead, we'll add code to handle specific fields (From, Subject) and that will get into the next release of FormMail.
    Last edited by russellr; 02-Jun-2009 at 01:28 AM. Reason: typo
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  7. #7
    Join Date
    May 2009
    Posts
    32

    Default Re: Solution for Encoding From Header in utf-8

    Quote Originally Posted by russellr View Post
    Hi,
    ...
    Instead, we'll add code to handle specific fields (From, Subject) and that will get into the next release of FormMail.
    Ok sounds good.

  8. #8
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Solution for Encoding From Header in utf-8

    Hi,

    Version 8.16 of FormMail now provides support for international encoding in From and Subject lines.

    It happens automatically when CharSet has been specified in either "mail_options" or in a language pack.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  9. #9
    Join Date
    May 2009
    Posts
    32

    Default Re: Solution for Encoding From Header in utf-8

    Thanks for letting us know. I will try it out the following weeks.

  10. #10
    Join Date
    Aug 2009
    Posts
    2

    Default Re: Solution for Encoding From Header in utf-8

    There's still a small bug left

    If there is a space in the field the text is garbled.
    For example in the fromline:
    "Åke" becomes "Åke"
    but
    "Åke A" becomes "=?UTF-8?Q?=C3=85ke A?="

    The subject line suffers from the same issue.
    Last edited by darmin; 10-Aug-2009 at 08:05 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Forcing charset in e-mail header
    By Wojtek in forum FormMail Subscription Support
    Replies: 14
    Last Post: 22-Feb-2005, 09:28 AM
  2. Session and Header errors
    By orange in forum FormMail Subscription Support
    Replies: 2
    Last Post: 09-Dec-2004, 02:16 AM
  3. Form attachments - encoding issue
    By mark70 in forum FormMail Subscription Support
    Replies: 5
    Last Post: 06-Oct-2004, 08:45 PM
  4. Error with Encoding
    By dunn123 in forum FormMailEncoder/Decoder
    Replies: 5
    Last Post: 06-Jul-2004, 09:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts