On 5/11/09 11:58 AM, "Thodoris" <[email protected]> wrote:
>
>> On 11 May 2009 at 18:25, Thodoris wrote:
>>
>>
>>> Hi gang,
>>> I am using phpmailer to send some mail notifications in an intranet
>>> I've made. This is a sample code:
>>>
>>
>>
>>> $e->Subject = "This is δφκξγκδφη garbidge κηδφκξγσ";
>>>
>>
>> Hi,
>>
>> I have had success with this in the past:
>>
>> $subject = "This is δφκξγκδφη garbidge κηδφκξγσ";
>> $e->Subject = mb_encode_mimeheader($subject, "UTF-8", "Q") ;
>>
>> Regards
>>
>> Ian
>>
>
> Thanks Ian this works in most cases but there are times that still
> breaks the subject. I have experimented with:
>
> mb_encode_mimeheader($subject, "UTF-8", "B")
>
> as well but nothing seems to be working without problems.
is it possible that in the problem cases the subject string isn't valid
utf-8?
you can check with mb_check_encoding($subject)
you can sanitize bad utf-8 with iconv("UTF-8","UTF-8//IGNORE",$subject)
though you probably won't get the string you want with that. when you don't
have other options, this will at least clean up bad encoding.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php