How to use different encodings for text in HTTP headers

In order to use different encodings than ASCII for HTTP headers use the following syntax:

Header-Key: Header-Value; Parameter-Name*=utf-8''parameter_value_in_utf8_and_encoded_chars

Concrete example how to use an utf8 encoded filename for file downloads (with fallback):

Content-Disposition: attachment; filename="aepfel"; filename*=utf-8''%c3%a4pfel
Ulrich Berkmueller Almost 13 years ago