The parameters filename and filename* differ only in that filename* uses the encoding defined in [RFC5987], allowing the use of characters not present in the ISO-8859-1 character set ([ISO-8859-1]).
Include a filename* parameter where the desired filename cannot be expressed faithfully using the filename form. Note that legacy user agents will not process this, and will fall back to using the "filename" parameter's content.
I'm opening this issue because:
[x] I have found a bug
My Go version / GOPATH is: N/A (N/A because I use the pre-compiled binary.)
How to Reproduce
Then open the link in iOS Safari. You'll find
å.txt
.Reason
The filename is declared in UTF-8 as
\xe5\x95\x8a.txt
in the headerContent-Disposition
, but Safari interprets it in ISO/IEC 8859-1 aså\x95\x8a.txt
.Possible solution
Add
filename*
inContent-Disposition
.https://github.com/claudiodangelis/qrcp/blob/8b35ad8a379cec8ce75878b557b8f3de165d39fb/server/server.go#L222-L223
§4.3. Disposition Parameter: 'Filename' - RFC 6266:
Appendix D. Advice on Generating Content-Disposition Header Fields - RFC 6266:
An example in RFC 6266:
The syntax of the value of
filename*
is specified in RFC 5987 §3.2.1:I can make a PR if you want.