Issue1681333
Created on 2007-03-15 11:13 by tkikuchi, last changed 2009-04-22 05:08 by ajaksu2.
|
msg52236 - (view) |
Author: Tokio Kikuchi (tkikuchi) |
Date: 2007-03-15 11:13 |
|
email.header.Header class has its unicode representation which is slightly different from str representation.
>>> h = email.Header.make_header((('[XXX]', 'us-ascii'), ('Re:', 'us-ascii')))
>>> unicode(h)
u'[XXX]Re:'
>>> str(h)
'[XXX] Re:'
Note that a white space between ']' and 'R' is absent from unicode representation. A word-separating space should be needed in following contexts:
lastcs \ nextcs | ascii | other |
ascii | sp | sp |
other | sp | nosp |
Current code fails to put a space for ascii\ascii case.
Also, if the ascii string has a trailing space, it may result in a extraneous double space which has semantically equivalent to a single space and sometimes annoying. You should use qp encoding for ascii charset if you insist on the presence of the space.
The patch includes test code. :)
|
|
msg52237 - (view) |
Author: Tokio Kikuchi (tkikuchi) |
Date: 2007-03-16 02:01 |
|
Sorry but I am withdrawing the latter part of the patch for ascii encoding. Revised patch is for only unicode representation.
File Added: email_header_unicode.patch
|
|
| Date |
User |
Action |
Args |
| 2009-04-22 05:08:27 | ajaksu2 | set | keywords:
+ easy |
| 2009-03-30 22:58:29 | ajaksu2 | set | stage: patch review type: behavior versions:
+ Python 2.6, - Python 2.5 |
| 2009-03-30 22:56:23 | ajaksu2 | link | issue1685453 dependencies |
| 2007-03-15 11:13:52 | tkikuchi | create | |
|