problem with internationalized headers in email package

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Manlio Perillo

    problem with internationalized headers in email package

    Hi.

    From RFC 2047:
    + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.
    + An 'encoded-word' MUST NOT appear within a 'quoted-string'.
    + An 'encoded-word' MUST NOT be used in a Received header field.
    + An 'encoded-word' MUST NOT be used in parameter of a MIME
    Content-Type or Content-Disposition field, or in any structured
    field body except within a 'comment' or 'phrase'.


    However (Python 2.5.2):
    >>h = Header(u'Andrè <andre@localhos t>')
    >>h.encode()
    '=?utf-8?b?QW5kcsOoIDx hbmRyZUBsb2NhbG hvc3Q+?='


    I'm not sure if this can be considered a bug, but surely this is an
    invalid header.



    Thanks Manlio Perillo
  • =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=

    #2
    Re: problem with internationaliz ed headers in email package

    + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.
    + An 'encoded-word' MUST NOT appear within a 'quoted-string'.
    + An 'encoded-word' MUST NOT be used in a Received header field.
    + An 'encoded-word' MUST NOT be used in parameter of a MIME
    Content-Type or Content-Disposition field, or in any structured
    field body except within a 'comment' or 'phrase'.
    >
    >
    However (Python 2.5.2):
    >
    >>>h = Header(u'Andrè <andre@localhos t>')
    >>>h.encode()
    '=?utf-8?b?QW5kcsOoIDx hbmRyZUBsb2NhbG hvc3Q+?='
    >
    >
    I'm not sure if this can be considered a bug, but surely this is an
    invalid header.
    Which of the conditions do you consider validated? It seems to me that
    this would make a completely correct Subject header, for example.

    Regards,
    Martin

    Comment

    Working...