Ignore:
Timestamp:
14 Jan 2012, 19:25:40 (13 years ago)
Author:
uli
Message:

Use iso-8859-1 instead of latin1 as mail part encoding name. Looks like Python 2.7 insists on the former as proper name.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/smtp.py

    r7470 r7472  
    108108    if not isinstance(item, unicode):
    109109        item = unicode(item, 'utf-8')
    110     return str(Header(item, 'latin1')) # try ascii, then latin1, then utf-8
     110    return str(Header(item, 'iso-8859-1')) # try ascii, then latin1, then utf-8
    111111
    112112def encode_address(addr, name=u''):
  • main/waeup.sirp/trunk/src/waeup/sirp/tests/test_smtp.py

    r7470 r7472  
    7979        result4 = encode_header_item(u'Name with umläut')
    8080        self.assertEqual(result1, u'Plain Name')
    81         self.assertEqual(result2, u'=?latin1?q?Name_with_uml=E4ut?=')
     81        self.assertEqual(result2, u'=?iso-8859-1?q?Name_with_uml=E4ut?=')
    8282        self.assertEqual(result3, u'Plain Name')
    83         self.assertEqual(result4, u'=?latin1?q?Name_with_uml=E4ut?=')
     83        self.assertEqual(result4, u'=?iso-8859-1?q?Name_with_uml=E4ut?=')
    8484        return
    8585
     
    9393        self.assertEqual(result2, 'The Foo <foo@bar.baz>')
    9494        self.assertEqual(result3, 'The Foo <foo@bar.baz>')
    95         self.assertEqual(result4, '=?latin1?q?With_Uml=E4ut?= <foo@bar.baz>')
     95        self.assertEqual(result4,
     96                         '=?iso-8859-1?q?With_Uml=E4ut?= <foo@bar.baz>')
    9697        return
    9798
Note: See TracChangeset for help on using the changeset viewer.