Patches item #1681333, was opened at 2007-03-15 11:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1681333&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Tokio Kikuchi (tkikuchi)
Assigned to: Nobody/Anonymous (nobody)
Summary: email.header unicode fix

Initial Comment:
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. :)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1681333&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to