PQM mis-encoding subject line
John Arbash Meinel
john at arbash-meinel.com
Wed Jun 28 14:02:30 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Olivier Grisel wrote:
> Robey Pointer a écrit :
>> A recent PQM email had a scrambled UTF-8 subject line. Looks like
>> it's encoding in UTF-8 but marking it as Latin-1.
>>
>>> Subject:
>>> =?iso-8859-1?q?Rev_1816=3A_=28erik_b=C3=A5gfors=29_remove_duplic?=
>>> =?iso-8859-1?q?ate_lines_in_help_and_NEWS_=28bug_=2350561=29_in_/h?=
>>> =?iso-8859-1?q?ome/pqm/archives/thelove/bzr/+trunk/?=
>>
>>
>> (Yes, that's insanely ugly, but that is actually the right way to do
>> it. The name of the encoding is the bit that's wrong.)
>
> It looks like a transfer encoding (quoted printable) that is not decoded.
>
Well, the submission was in utf-8, and bzr seems to accept it in utf-8,
since it is recorded correctly in the history.
I had to fix my 'pqm-submit' plugin to actually do foo.encode('utf8'),
but I only found out because ASCII doesn't have that character.
I don't know how the PQM is sending out emails, but it may not realize
it is dealing with utf-8.
I didn't do anything special (like set up a special header to indicate
the encoding was utf-8). I suppose I should, but I'm not that well
versed in the exact meaning of all SMTP headers.
Is it sufficient to just add 'Content-Type: text/plain; charset=UTF-8'?
That is what my mailer does, and it seems to happen before the Subject line.
It seems like we need more than that, since my test email came back with:
Test =?UTF-8?B?2KzZiNis2Yg=?=
And the Content-Type line actually happened after the Subject this time.
Well, at least the pqm accepted my email and handled it correctly. I
have the feeling if we 'munged it properly' we would have gotten all
those extra characters in the commit message.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEon3mJdeBCYSNAAMRAun7AKDPhAuvxbQ4w7/twP/LrWuY7AkGWACfU7OX
YN4NVMEVhpOwYVFvgrshVPg=
=U2sf
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list