From How to encode the filename parameter of Content-Disposition header in HTTP? I learnt that the encoding defined in RFC 5987 is used to encode filenames in Content-disposition
headers. And from https://stackoverflow.com/a/1361646/739619 I learnt that support in major browsers is good at least since November 2012. Both questions are rather old, yet I couldn't find a standard way to encode filenames according to this encoding in python / tornado. I have a
self.set_header('Content-Disposition', 'attachment;filename="{}.{}"'.format(basename, format))
in my code that fails when basename
contains characters outside latin1, and I am loking for a standard way to encode it.