Page 1 of 1

Problems on long subjects with UTF8 charset

Posted: Wed Apr 25, 2007 1:36 pm
by oldrich
I like SwiftMailer, but I have to report the bug.
I use Swift-3.1.5-php4
Wrong longer subject with utf8 charset - bad compartmentalization.
UTF-8 uses one to four bytes per character, depending on the Unicode symbol.

Swift now produces
Subject: =?utf-8?Q?Varov=C3=A1n=C3=AD_p=C5=99ed_expirac=C3=AD_dom=C3?=
=?utf-8?Q?=A9ny_logomix?=

it should be like this
Subject: =?utf-8?Q?Varov=C3=A1n=C3=AD_p=C5=99ed_expirac=C3=AD_dom=C3=A9?=
=?utf-8?Q?ny_logomix?=

Thank you
Oldrich

Posted: Wed Apr 25, 2007 2:06 pm
by Chris Corbyn
Can anyone provide a patch for this? Or an explanation of how I would detect where it's safe to cut the string? :( I didn't actually think decoding would be affected by this since I expected it to simply convert back to the original byte order. Base64 encoded headers should provide you with a temporary solution:

Code: Select all

$message->headers->setEncoding("B");
I'd love some guidance from someone well-versed in character encodings because RFC 2822 does not cover this stuff.

Thanks for the heads-up :)

EDIT | Educated guess work here, but is the =C3 signficant in detecting this?

Posted: Wed Apr 25, 2007 4:44 pm
by Chris Corbyn
Update: Thread created here for support on the encoding issue since I'm no expert with UTF-8.