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)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think this should do it:
Note that this function expects that the output is used in a separate line preceded by a proper line wrap (i.e. CRLF), e.g.:
The output is:
See also Test Cases for HTTP Content-Disposition header field and the Encodings defined in RFC 2047 and RFC 2231/5987.