Page 1 of 1

Non-ASCII subject / names in To, CC, BCC

Posted: Wed Jun 04, 2008 10:49 am
by Ilija Studen
Users have reported several occurrences where Subjects and Sender names that contain "special" characters are lost. How can I make sure that these information is set as UTF.

All of the data is pulled from DB and we cannot guarantee that it will always be done through UTF connection, but I can do character conversion before setting the values. Any pointer would be great.

PS: I can provide screenshot with all headers as an example.

Re: Non-ASCII subject / names in To, CC, BCC

Posted: Thu Jun 05, 2008 5:36 am
by Chris Corbyn
Currently:

Code: Select all

$message->headers->setEncoding('B'); //This is only needed because of a bug in v3
$message->headers->setCharset('utf-8');
$message->setCharset('utf-8'); //You probably want this line too
And just because v4 is about to be released, in v4 if you upgrade:

Code: Select all

$message->getHeaders()->setCharset('utf-8');
 
//Or if you want to affect the entire message
$message->setCharset('utf-8');