Re: Content-Disposition and utf8 filenames
[email protected] (Bjoern Hoehrmann) Sat, 04 Dec 2010 15:40:50 +0100
| Newsgroups | perl.libwww |
|---|---|
| Message-ID | <[email protected]> |
* Bill Moseley wrote: >I would like to use a user-supplied filename when returning a download (e.g. >pdf). For example, might be filename="$title.pdf". But $title can include >any character. > >It seems like support for this in browsers is spotty: See: >http://greenbytes.de/tech/tc2231/ > >Is anyone aware of a way to set this header to allow utf8 filenames that is >supported across browsers? No, as you can tell from the results there is no one way supported by all major browsers. The IETF HTTPbis Working Group is currently revising the specification for it, and the recommended way to do this will be the through the RFC 5987 style notation, where you can also specify a fall- back value by using both the filename* and filename parameters. But no silver bullet there. >Also, my assumption is HTTP::Headers expect encoded values -- that is the >values are octets not characters and so should always encode( 'US-ASCII' ) >the value. (That is generally correct, yes). >I just tried with Google Apps and it seems they turn any non A-Za-z into an >underscore. Not sure that means they just didn't try hard or if they felt >it was not possible to use non ASCII characters in suggested filenames. As I understand it, Google is currently investigating switching to RFC 5987 style encoding in some of their applications. -- Björn Höhrmann · mailto:[email protected] · http://bjoern.hoehrmann.de Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de 25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/