Charset setting ignored?

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
HHahn
Forum Commoner
Posts: 43
Joined: Mon Mar 02, 2009 9:16 am
Location: Veldhoven, Netherlands

Charset setting ignored?

Post by HHahn »

I tried to set the Charset to, e.g., "iso-8859-4", "iso-8859-8", "utf-7", "utf-8" and some others. In all cases, the received message had "iso-8859-1", except if I insert one or more UTF-8 characters into the header.
This behaviour is seemingly in line with the documentation, except that the latter suggests that the default setting (ISO-8859-1 or UTF-8) can be overruled by e.g. $message->setCharset ("iso-8859-4") or similar.

It seems that this overruling the default does not work. Is this a bug, or do I misunderstand something?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Charset setting ignored?

Post by Chris Corbyn »

Can you post the full code please? In version 3 you need to set the charset on each MIME part and on the message itself. It's a bit awkward. Version 4 fixes/streamlines this so you only need to set it on the message.
HHahn
Forum Commoner
Posts: 43
Joined: Mon Mar 02, 2009 9:16 am
Location: Veldhoven, Netherlands

Re: Charset setting ignored?

Post by HHahn »

Dear mr. Corbyn,

Thanks, it now works. I wasn't aware that I had to set the charset for every message part. I now looked at the documentation for the Swift_Message_Part class, where I indeed found a method setCharset. Specifying this for each message part solved the problem.

By the way, when will version 4 be released? I prefer not to use a beta version.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Charset setting ignored?

Post by Chris Corbyn »

HHahn wrote:By the way, when will version 4 be released? I prefer not to use a beta version.
It was supposed to be released over a week ago. I'm running really behind getting the new website up and running and can't seem to find the time to get it finished by the time I get in from work on the evenings. The short answer is "soon" ;)
HHahn
Forum Commoner
Posts: 43
Joined: Mon Mar 02, 2009 9:16 am
Location: Veldhoven, Netherlands

Re: Charset setting ignored?

Post by HHahn »

Chris Corbyn wrote:The short answer is "soon"
Fine. Do you announce it here on the forum, so that all those who subscribe will be notified?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Charset setting ignored?

Post by Chris Corbyn »

Yeah I'll announce it on the forum and on the google group, and the website will look completely different ;)
Post Reply