You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2012/01/16 13:19:29 UTC

DO NOT REPLY [Bug 118791] XMailMessage attachment unusable if file name (ReadableName) contains non-ASCII characters

https://issues.apache.org/ooo/show_bug.cgi?id=118791

Ariel Constenla-Haile <ar...@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 <ar...@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.