HTTP-header fails on 8-bit characters in Mozilla 1.4
Posted: Fri Apr 25, 2003 6:08 pm
Code: Select all
header("Content-type: application/msword");
header('Content-Disposition: attachment; filename=skåp.doc');It works if the filename is "skap.doc" but doesn't when the filename is "skåp.doc".
This is a problem related primarily to Mozilla, but the problem is, the developers of Mozilla turned my bug report down and said that my application was out of specification, since å is an 8-bit character.
Here is the message I got:
and here is where my mozilla bug report discussion is:Not a bug; your Content-Disposition header is out of spec. Non us-ascii strings
must use MIME parameter-value encoding. See RFC 2231
http://bugzilla.mozilla.org/show_bug.cgi?id=65827#c75
The symptom is:
Instead of the suggested file name "skåp.doc", the browser presents the SCRIPTS file name in the "Save As..." dialog, which is not very good. It works fine in all other situations BUT when 8-bit characters go along with the filename.
So, silly me tries something like
Code: Select all
header("Content-type: application/msword");
header('Content-Disposition: attachment; filename="=?iso-8859-1?Q?sk=E5p.doc?="');I will continue trying, but would be happy for any helping hands.