HTTP 1.1 is a well-known hypertext protocol for data transfer. HTTP messages are encoded with ISO-8859-1 (which can be nominally considered as an enhanced ASCII version, containing umlauts, diacritic and other characters of West European languages). At the same time, the message body can use another encoding assigned in “Content-Type" header. But what shall we do if we need to assign non-ASCII characters not in the message bodies, but in the header? Probably the most well-known case is setting a filename in the "Content-Disposition" header. It seems like a common task, but its implementation isn’t obviou
TL;DR: Use the encoding described in RFC 6266 for "Content-Disposition" and transliterate it to Latin in other cases.