Comment 4 for bug 160530

Revision history for this message
John A Meinel (jameinel) wrote :

Well, there are 2 bits.

1) It technically could have done:
    "(Adeodato =?UTF-8?B?U2l=) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time"

And only encoded the single character that was not ascii.

I think the reason the whole string was encoded was because of the email module.

In fact, I'm surprised that the whole string wasn't one =?UTF-8?B?....=
I'm guessing that python2.4 would have done that, because that is the code I've looked at more.

In fact, with 2.4 I get
>>> msg = bzrlib.email_message.EmailMessage('joe@foo', ['joe@foo'], u'Testing \xe5')
>>> str(msg._headers['Subject'])
'=?utf-8?q?Testing_=C3=A5?='

This is because the quoted printable was shorter than the base64 encoded form. But if you put more characters in, that will eventually shift.

>>> msg = bzrlib.email_message.EmailMessage('joe@foo', ['joe@foo'], u'Testing \u062c\u0648\u062c\u0648')
>>> str(msg._headers['Subject'])
'=?utf-8?b?VGVzdGluZyDYrNmI2KzZiA==?='

2) PQM doesn't support any sort of quoting anyway. So regardless we need to send a raw UTF-8 Subject line, because that is what PQM expects.