__unicode__(): Fix the logic for calculating whether to add a

separating space or not between encoded chunks.  Closes SF bug
#710498.
This commit is contained in:
Barry Warsaw 2003-03-30 20:46:47 +00:00
parent 742dde4ddd
commit ba1548a736
1 changed files with 3 additions and 3 deletions

View File

@ -215,11 +215,11 @@ class Header:
# charset. Only do this for the second and subsequent chunks.
nextcs = charset
if uchunks:
if lastcs is not None:
if nextcs is None or nextcs == 'us-ascii':
if lastcs not in (None, 'us-ascii'):
if nextcs in (None, 'us-ascii'):
uchunks.append(USPACE)
nextcs = None
elif nextcs is not None and nextcs <> 'us-ascii':
elif nextcs not in (None, 'us-ascii'):
uchunks.append(USPACE)
lastcs = nextcs
uchunks.append(unicode(s, str(charset)))