Tracker: Bugs

5 Unicode support for email is incorrect - ID: 1842194
Last Update: Comment added ( sits )

Initially observed in: 1.9.3
Also Tested in: 1.9.4rc3 (the live example site)

The Unicode encoding for the subject line of the alert emails is incorrect, the supplied topic for the report was:
testing=testing_testing

Which generates a subject line of:
[REVIEW] Topic Created "testing=testing_testing"

Although this is UTF-8 encoded, which is where the problem lies. The expected raw subject line obtained is:
=?UTF-8?Q?[REVIEW]_Topic_Created_"testing=3Dtesting=5Ftesting"?=

The raw email subject line obtained is:
=?UTF-8?Q?[REVIEW] Topic Created "testing=3Dtesting_testing"?=

Spaces are not allowed in that encoding according to RFC 2047. They need to be encoded with an underscore. obviously any existing underscores need to be encoded to the hex code for that ascii character so that they aren't clobbered.

I've attached the email with the bad subject line, I'll try to attach a fixed copy after posting this.


Jon ( jon787 ) - 2007-11-30 22:24:27 PST

5

Closed

Accepted

Nobody/Anonymous

None

None

Public


Comments ( 4 )

Date: 2008-01-08 20:26:00 PST
Sender: sitsProject Admin


Thanks for that - have committed it in.



Date: 2007-12-01 12:41:11 PST
Sender: jon787


Patch verified against install of CodeStriker 1.9.4 with PostgreSQL
backend. I'm not sure it fixes everything, but it seems to generate proper
email headers now.

PS: The Live site isn't setup for Unicode. It worked fine when I tried that
on my own install.
File Added: unicode-email.diff


Date: 2007-12-01 00:17:04 PST
Sender: jon787


Well I can't say that I've tested this on a live site, but the attached
patch should fix the emailing problem. It also fixes another little issue I
noticed where encode("UTF-8", $string) should only be used if
is_utf($string) is true.

Is the live demo setup for true Unicode? It doesn't seem to like it much:
http://codestriker.sourceforge.net/cgi-bin/codestriker.pl?topic=5590019&action=view&mode=1&brmode=1&fview=-1

I tried submitting a ticket for "Комитет
государственной безопасности" (KGB in cyrillic)
File Added: unicode-email.diff


Date: 2007-11-30 22:25:19 PST
Sender: jon787


Attaching a fixed copy of the same email.
File Added: fixed.txt


Attached Files ( 3 )

Filename Description Download
mail.txt Example broken file Download
fixed.txt Sample corrected email Download
unicode-email.diff Patch to fix email Download

Changes ( 10 )

Field Old Value Date By
close_date - 2008-01-08 20:26:00 PST sits
resolution_id None 2008-01-08 20:26:00 PST sits
status_id Open 2008-01-08 20:26:00 PST sits
File Deleted 256894: 2007-12-01 12:42:02 PST jon787
File Deleted 256832: 2007-12-01 12:41:14 PST jon787
File Added 256895: unicode-email.diff 2007-12-01 12:41:11 PST jon787
File Added 256894: unicode-email.diff 2007-12-01 12:40:24 PST nobody
File Added 256832: unicode-email.diff 2007-12-01 00:17:04 PST jon787
File Added 256826: fixed.txt 2007-11-30 22:25:19 PST jon787
File Added 256825: mail.txt 2007-11-30 22:24:27 PST jon787