Problems if message subject contains both umlauts and question mark

36 views
Skip to first unread message

Otto

unread,
Jan 27, 2009, 1:52:13 AM1/27/09
to mimemessage-dev
Hi,

I guess this is a software bug.

If my MIME/UTF-8 message's subject contains both umlauts and a
question mark, the question mark apparently gets not MIME encoded
correctly and the whole subject looks weired.

I guess in this case, the question mark should be encoded as "=3F",
but it is not.

Example:

"Können wir sie unterstützen?"

looks like:

"=?UTF-8?q?K=C3=B6nnen_wir_sie_unterst=C3=BCtzen??="

source looks like this:

Subject: =?UTF-8?q?K=C3=B6nnen_wir_sie_unterst=C3=BCtzen??=

working source would be:

Subject: K=?UTF-8?q?=C3=B6nnen_wir_sie_unterst=C3=BCtzen=3F?=

Manuel Lemos

unread,
Jan 27, 2009, 2:31:53 AM1/27/09
to mimemes...@googlegroups.com
Hello,

on 01/27/2009 04:52 AM Otto said the following:

I tried this case and it worked correctly. There is even a case of
test_quoted_printable.php script that tests question marks at the end of
headers. Could you be using an old version of the class with bugs?

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Otto

unread,
Jan 27, 2009, 2:38:49 AM1/27/09
to mimemessage-dev
Manuel,

Thank you for your quick reply.

What I discovered in the meantime:

If I replace one line in "SetEncodedHeader", it is working:

OLD:
return($this->SetHeader($header,$value,strlen($encoding_charset) ?
$encoding_charset : $this->default_charset));

NEW:
return($this->SetHeader($header,$this->QuotedPrintableEncode($value,
strlen($encoding_charset) ? $encoding_charset : $this-
>default_charset, 1, 1)));


I guess I am using v 1.86

@(#) $Header: /home/mlemos/cvsroot/mimemessage/email_message.php,v
1.86 2008/12/06 18:05:41 mlemos Exp $

Manuel Lemos

unread,
Jan 27, 2009, 2:47:52 AM1/27/09
to mimemes...@googlegroups.com
Hello,

on 01/27/2009 05:38 AM Otto said the following:


> Manuel,
>
> Thank you for your quick reply.
>
> What I discovered in the meantime:
>
> If I replace one line in "SetEncodedHeader", it is working:

Yes, for headers that may contain non-ASCII characters, like for
instance Subject, you should always use SetEncodedHeader.

Otto

unread,
Jan 27, 2009, 2:56:44 AM1/27/09
to mimemessage-dev
Sur. But in my software version SetEncodedHeader did NOT call the
QuotedPrintableEncode funtion. So I guess this is the reason why my
header was not encoded correctly.


On 27 Jan., 08:47, Manuel Lemos <mle...@acm.org> wrote:
> Hello,
>
> on 01/27/2009 05:38 AM Otto said the following:
>
> > Manuel,
>
> > Thank you for your quick reply.
>
> > What I discovered in the meantime:
>
> > If I replace one line in "SetEncodedHeader", it is working:
>
> Yes, for headers that may contain non-ASCII characters, like for
> instance Subject, you should always use SetEncodedHeader.
>
> --
>
> Regards,
> Manuel Lemos
>
> Find and post PHP jobshttp://www.phpclasses.org/jobs/
Reply all
Reply to author
Forward
0 new messages