![]() |
E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail (/showthread.php?tid=19584) |
E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail - El Forum - 06-11-2009 [eluser]Ki[/eluser] Hi, I dont want to yell "BUG!!!" just because I have encountered this unexpected behavior BUT I noticed that email subjects with non-english characters (cyrillic) end up showing as "=d0=97=d0=95=d0" when they are longer then a certain length. I was able to fix it by making 2 modifications to Email Class -> function _prep_q_encoding Modifications (2): Code: for ($i = 0, $length = strlen($str); $i < $length; $i++) Here are my headers With 'bad' email subject: Subject: =?utf-8?Q?Objava: =d0=97=d0=95=d0=9c=d0=af =d0=a1=d0=9c=d0=95=d0=9b=d0?= =?utf-8?Q?=9d=d0=98=d0=a6=d0=90?= With 'fixed' email subject: Subject: =?utf-8?Q?Objava: ÐÐÐЯ СÐÐÐÐÐЦÐ?= Can someone comment on this Is this a bug? May I have other issues by commenting out those sections of the class (mentioned above)? Ki E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail - El Forum - 08-17-2009 [eluser]Kromack[/eluser] Same issue for me, thanks for the trick. E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail - El Forum - 07-31-2011 [eluser]takasia[/eluser] Thanks! This really saved my time :-) I commented out also this line: $str = trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $str)); After that, I got this: Subject: MY_TEXT_IN_JAPANESE instead of this: Subject: =?utf-8?Q?MY_TEXT_IN_JAPANESE?= E-Mail with UTF encoded Subject - if longer then expected length => becomes garbled in gmail - El Forum - 10-15-2012 [eluser]Narf[/eluser] How about this: https://gist.github.com/3891474 More info: https://github.com/EllisLab/CodeIgniter/issues/1409#issuecomment-9330713 |