I just had this problem. This question was helpful.
The reason, as you pointed out, is that Chrome is trying to decode it, and not outside of ASCII. I would call it a mistake personally.
Basically, the answer to make it work in Chrome is to use:
Content-Disposition:attachment; filename*=UTF-8''GB2312%D5%D5%C6%AC.JPG
However, this will break it in IE8 and Safari. Ugh! To make it work in this, try to do it like this example .
Content-Disposition:attachment; filename="GB2312%D5%D5%C6%AC.JPG"; filename*=UTF-8''GB2312%D5%D5%C6%AC.JPG
For me, I had to encode the file name before putting it in the file name * = UTF-8. So my values ββfor the first file name and the second value do not match. I used PHP and my code is as follows:
$encodedfilename = urlencode($downloadfilename); header("Content-Disposition: attachment; filename=\"$downloadfilename\"; filename*=UTF-8''$encodedfilename");
This way, I don't actually stop it from encoding, as you requested, but I encode it, and then pass the parameter that Chrome decodes back to what it should.
source share