Questions tagged [rfc2231]

RFC 2231 issued by the IETF in 1997 is about "MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations"

Abstract from official RFC file:

This memo defines extensions to the RFC 2045 media type and RFC 2183 disposition parameter value mechanisms to provide

  1. a means to specify parameter values in character sets other than US-ASCII,

  2. to specify the language to be used should the value be displayed, and

  3. a continuation mechanism for long parameter values to avoid problems with header line wrapping.

This memo also defines an extension to the encoded words defined in RFC 2047 to allow the specification of the language to be used for display as well as the character set.

6 questions
6
votes
1 answer

PHP: RFC-2231 How to encode UTF-8 String as Content-Disposition filename

Scenario: (in PHP) I have a form submission with a UTF-8 encoded string ($name) to support international characters. Upon submitting the form (via GET), I am creating a CSV download file. I want the name of the file to be that string + .csv …
5
votes
3 answers

Email an attachment with non-ascii filename with python email

How can I send an email with a file attached where the file name contains unicode characters? Up to now, the file will arrive but with the filename "noname". This is the part that works perfectly well for ASCII filenames: import smtplib from…
Suzana
  • 4,251
  • 2
  • 28
  • 52
3
votes
1 answer

How can I encode a filename in PHP according to RFC 2231?

How can I encode the value of a filename according to the encoding of MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations (RFC 2231)?
Juanjo Conti
  • 28,823
  • 42
  • 111
  • 133
3
votes
1 answer

How can I encode a filename according to RFC 2231?

I need to encode file attachments at the Content-Disposition HTTP header attribute. I noticed that RFC 2231 is the latest widely-accepted standard and would like to use that. However, I have trouble finding an implementation of that within the core…
Some Newbie
  • 1,059
  • 3
  • 14
  • 33
2
votes
1 answer

How to encode the filename parameter value of the Content-Disposition header in MIME message?

By checking the source of some emails, I found that many emails use 'Encoded Words' (RFC 2047) format to encode the filename parameter values. However, according to RFC 2047, this encoding method should not be used to header parameter values.…
Gödel
  • 592
  • 4
  • 21
2
votes
2 answers

How can I decode a string that has been encoded using RFC2231 using PHP

I am parsing MIME formatted emails which have attachments. The attachments have their filenames encoded using RFC2231, so for example the 'content-disposition' of one of the attached files is: attachment; filename*=utf-8''Bill%20Sixteen.pdf How do…
Nada_Surf
  • 616
  • 1
  • 7
  • 19