incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 118791] XMailMessage attachment unusable if file name (ReadableName) contains non-ASCII characters
Date Mon, 16 Jan 2012 12:19:29 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=118791

Ariel Constenla-Haile <arielch@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |STARTED
                 CC|                            |arielch@apache.org
           Platform|PC                          |All
         AssignedTo|tbo@openoffice.org          |arielch@apache.org
     Ever Confirmed|0                           |1
         OS/Version|Windows XP                  |All
           Severity|enhancement                 |normal

--- Comment #1 from Ariel Constenla-Haile <arielch@apache.org> 2012-01-16 12:19:29 UTC
---
According to
http://docs.python.org/library/email.message.html?highlight=add_header#email.message.Message.add_header

For each item in the keyword argument dictionary _params, the key is taken as
the parameter name, with underscores converted to dashes (since dashes are
illegal in Python identifiers). Normally, the parameter will be added as
key="value" unless the value is None, in which case only the key will be added.
If the value contains non-ASCII characters, it must be specified as a three
tuple in the format (CHARSET, LANGUAGE, VALUE), where CHARSET is a string
naming the charset to be used to encode the value, LANGUAGE can usually be set
to None or the empty string (see RFC 2231 for other possibilities), and VALUE
is the string value containing non-ASCII code points.

An example with non-ASCII characters:

msg.add_header('Content-Disposition', 'attachment',
               filename=('iso-8859-1', '', 'Fußballer.ppt'))

Which produces

Content-Disposition: attachment; filename*="iso-8859-1''Fu%DFballer.ppt"

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Mime
View raw message