email subject in utf 8 is not work! |
[eluser]vee[/eluser]
this is subject in Thai language. $subject = "หัวข้อของอีเมล์ภาษาไทย UTF-8" if i just use Code: $this->email->subject($subject); Quote:หัวข้อ��ทย UTF-8 i have to add encode utf-8 for multi language subject work (refer from http://www.php.net/manual/en/function.mail.php) then i use this code Code: '=?UTF-8?B?'.base64_encode($subject).'?=' subject in email is Quote:=?UTF-8?B?4Lir4Lix4Lin4LiC4LmJ4Lit4LiC4Lit4LiH4Lit4Li14LmA4Lih4Lil4LmM4Lig4Liy4Lip4Liy4LmE4LiX4LiiIFVURi04?= but.. i check on system/libraries/Email.php page comment/remove this line Code: $subject = $this->_prep_q_encoding($subject); it's work! so.. i don't know what's that line for? for make subject utf-8 won't work? is there a way to make it work without mess with ci library? thank you
[eluser]Jazmo[/eluser]
You can't do anything without modifying the ci library or extending the email library. I have the similar problem. I don't know why there's a need for _prep_q_encoding, because '=?utf-8?B?'. base64_encode($subject). '?=' seems to work everywhere in every situation.
[eluser]Jazmo[/eluser]
Put Code: class MY_Email extends CI_Email
[eluser]Unknown[/eluser]
Just to let you all know. All emails i sended from CI had '=?UTF-8?B?' as subject, i diged the wrong direction so it costed me "some" time to find out that the problem was that i sended an empty string to the subject (because of empty lang file). Case solved ![]() Cheers, Gerard
[eluser]Unknown[/eluser]
@Jazmo: How do I load this library? This doesn't work: Code: $this->load->library('MY_Email')
[eluser]Narf[/eluser]
This issue has already been fixed in CodeIgniter's GitHub repository. You can get the fixed version from here: https://github.com/EllisLab/CodeIgniter/.../Email.php
|
Welcome Guest, Not a member yet? Register Sign In |