The file name is: Ten Chinese documents (201001__10_39_19.pdf
Example: May 1234 80 or 90 (201001__10_39_191 _
IE version: 6.0 SP2
I have read a lot of online discussions about the problem that more than 17 Chinese characters cannot be downloaded, for example, http://wangxiaojs.javaeye.com/blog/292107:
Reference
It seems a valid solution to encode a file name into a ISO8859-1
However, after I encode the file name into a ISO8859-1 and use ie6.0sp2 to download the default file name is still truncated, the default file name is as follows
19th percentile
I am now processing the file name first by UTF-8 encoding as follows:
Urlencoder. encode (filename, "UTF-8 ");
Then carry out ISO8859-1 encoding processing:
Filename = new string (report. getbytes ("gb2312"), "ISO8859-1 ")
Finally:
Response. setheader ("content-disposition", "attachment; filename =" + filename );
Supplement:
Sorry, I am not careful enough.
The original file name is 1234, 80 or 90, 20100127/10, 39/19 bytes.
IE8 and FF will parse \ into _, so it can be output normally
IE6 is relatively stupid, And/The previous characters are lost, so the output is incorrect.