Results 1 to 4 of 4

Thread: Problem with unicode characters in Subject field

  1. #1
    athan00 is offline Junior Member
    Join Date
    Mar 2006
    Posts
    2

    Default Problem with unicode characters in Subject field

    Hi,

    I installed SugarCRM 4.2 latest version. When I m writing in the subject a title not in English language but in Greek (unicode characters) then the field does not save all the characters but trims the phrase and adds a "&" at the end of the phrase.

    Any solution? Please help!

    Thanks

    Athan

  2. #2
    iason.schizas is offline Sugar Community Member
    Join Date
    Jan 2006
    Posts
    22

    Default Re: Problem with unicode characters in Subject field

    I had the same issue with characters in Greek. I use SugarCRM 5.1.0 and UTF-8. It seemed to me that the code was asking for UTF-8 characters in the subject to be retranslated to UTF-8 so this was causing the problem.

    What I did is remark 2 lines of code and add 2 extra and it worked for me.

    include\SugarPHPMailer.php(280):
    Line 280:
    // To correct display of characters
    $subject = from_html(trim($this->Subject));
    $this->Subject = from_html(trim($this->Subject));

    // $subject = $locale->translateCharset($subjectUTF8, 'UTF-8', $OBCharset);
    // $this->Subject = $locale->translateCharsetMIME($subjectUTF8, 'UTF-8', $OBCharset);

  3. #3
    yyovkov is offline Junior Member
    Join Date
    Jan 2008
    Posts
    3

    Default Re: Problem with unicode characters in Subject field

    I have test this solution, but it is also not perfect.
    The last few letters when I am sending email in Bulgarian (UTF-8) are not displayed correct.

    Is there any other solution to this issue?

    Regards!

  4. #4
    jussik is offline Sugar Community Member
    Join Date
    May 2008
    Posts
    17

    Default Re: Problem with unicode characters in Subject field

    Thanks for the thread, saved me a lot of time!

    There seems to be some fixes to this bug in 5.1.0a.
    I needed a quick fix for this immidiately for 5.1.0 and
    it looks like that In Sugar 5.1.0a this bug is fixed like this:

    Code:
    Change row 280:
                 $this->Subject            = $locale->translateCharsetMIME($subjectUTF8, 'UTF-8', $OBCharset);
    to:
                 $this->Subject            = $locale->translateCharset($subjectUTF8, 'UTF-8', $OBCharset);
    Only difference is that MIME has been erased from the translateCharset:
    The same problem seems to be with other fields also.
    With only superficial testing everything seems to work. Here's the whole diff between 5.1.0 and 5.1.0a that handles the rest of the fields like to and for:
    Code:
    <             $this->Subject            = $locale->translateCharset($subjectUTF8, 'UTF-8', $OBCharset);
    ---
    >             $this->Subject            = $locale->translateCharsetMIME($subjectUTF8, 'UTF-8', $OBCharset);
    302c302
    <                       $this->FromName         = $locale->translateCharset(trim($this->FromName), 'UTF-8', $OBCharset);
    ---
    >                       $this->FromName         = $locale->translateCharsetMIME(trim($this->FromName), 'UTF-8', $OBCharset);
    304c304
    <                               $this->ReplyTo[$k][1] = $locale->translateCharset(trim($v[1]), 'UTF-8', $OBCharset);
    ---
    >                               $this->ReplyTo[$k][1] = $locale->translateCharsetMIME(trim($v[1]), 'UTF-8', $OBCharset);
    308c308
    <                               $this->to[$k][1]        = $locale->translateCharset(trim($toArr[1]), 'UTF-8', $OBCharset);
    ---
    >                               $this->to[$k][1]        = $locale->translateCharsetMIME(trim($toArr[1]), 'UTF-8', $OBCharset);
    312c312
    <                               $this->cc[$k][1]        = $locale->translateCharset(trim($ccAddr[1]), 'UTF-8', $OBCharset);
    ---
    >                               $this->cc[$k][1]        = $locale->translateCharsetMIME(trim($ccAddr[1]), 'UTF-8', $OBCharset);
    316c316
    <                               $this->bcc[$k][1]       = $locale->translateCharset(trim($bccAddr[1]), 'UTF-8', $OBCharset);
    ---
    >                               $this->bcc[$k][1]       = $locale->translateCharsetMIME(trim($bccAddr[1]), 'UTF-8', $OBCharset);

Thread Information

Users Browsing this Thread

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

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
  •