In the previous project, we found that PHPHeader was used to forcibly download the Chinese garbled characters of IE file names. this is a certain browser, which everyone knows... Amp; nbsp; solution: (my page is UTF-8 encoded): Invalid filename=quot=chinese .txt
I found that the PHP Header was used in the previous project to forcibly download the Chinese garbled characters of the
Recently, the customer found a problem when using our traffic monitoring system and GA. The data we calculated is much more than twice that of GA, and in the data we collected, the bounce rate is very high, up to about 99%. After some simple troubleshooting, I found the problem and failed to set the Cookie.
But as to why the failure occurred, I checked the problem for half a day and finally mentioned above in StackOverflow that IE cannot set cookie
To solve the problem of PHP downloading files in IE and garbled file names, you can use the following code to export the files as streams instead of opening the file header ("Content-Type: application/force-download; charset = utf-8; name = \ "$ file_name \"); header ("solves the problem of PHP downloading files in IE and garbled file
The following code submits data and file names in excel format to the server. PHP converts requests to downloadable excel files, in addition, the browser is required to bring up the file download prompt window. a problem occurs in the middle: the submitted Chinese file name is directly put in the header, and it will become garbled in IE. the solution is to urlencode the file name and then put it in the head
In (x) HTML, some special characters should be HTML Entity escaping.
Common examples include: (and), "(double quotation marks), '(single quotation marks),
But the question is, why is the conversion of single quotes different from other special characters? Why is entity number ( #039;) used only in single quotes, and entity name ( apos;) used in other operations?
The reason is that the IE browser does not currently support Entity
One problem encountered in the middle is that the submitted Chinese file name is directly put in the header and will become garbled characters in IE. The solution is to urlencode the file name first and then put it in the header, as shown below.Copy codeThe Code is as follows:$ File_name = urlencode ($ _ REQUEST ['filename']);Header ("Pragma: public"); header ("Expires: 0 ");Header ("Cache-Control: must-revalidate, post-check = 0, pre-check = 0 ");Hea
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.