The general notepad is ansi format Oh, we convert it to uft-8 must be output with \ xEF \ xBB \ xBF. Generally, notepad is in ansi format, when converting the uft-8, we must use the \ xEF \ xBB \ xBF feature.
Script ec (2); script
Mysql in the utf8_general_ci is corresponding to the php document UTF-8 is the file format of UTF-8 without BOM encoding? Mysql in the utf8_general_ci is corresponding to the php document UTF-8 is the file format of UTF-8 without BOM encoding?
The file header contains BOM information (three bytes.The advantage is that the multi-encoding editor can correctly recognize the file encoding.
MicroSoft added ef bb bf three bytes before your own UTF-8 format text file,Notepad on
So that some characters (especially wide characters) cannot be correctly displayed, that is, they are no longer in UTF-8 format.
Solution:When the output file is opened, the encoding format is specified, so no garbled characters will occur after
When the require function is used in php to load the utf8 file, an empty line is generated because several UTF-8 characters are generated during file editing in windows, these characters are called Unicode signatures (BOM ).
The use of require is
Remember to run the code before you back up the file Oh, to avoid failure problems.Code One:
function Checkbom ($filename) {
global $auto;
$contents = file_get_contents ($filename);
$charset [1] = substr ($contents, 0, 1);
$
Copy Code code as follows:
' This program reduces the reading of the database by using the FSO function of ASP. After testing, you can reduce the server load by 90%. Page access speed is basically equivalent to static pages.
' How to:
This allows some characters (especially wide characters) to be displayed incorrectly, which is no longer utf-8 format.
Solution:When you open the output file, you specify the encoding format, and there is no garbled situation after the output file
Remember to back up the files before running the code oh, to avoid failure problems.
Code One:
Copy CodeThe code is as follows:
function Checkbom ($filename) {
Global $auto;
$contents = file_get_contents ($filename);
$charset [1] = substr
1. What is the BOM header?In a UTF-8 encoded file, the BOM occupies three bytes in the file header to identify the file as a UTF-8 encoded file. Currently, many software programs have recognized the BOM header, but some cannot recognize the BOM
Copy codeThe Code is as follows:
'The program uses the FSO function of ASP to reduce database reading. Tested, the server load can be reduced by 90%. The page access speed is basically the same as that of static pages.
'Usage: place the file on
Scenario:
Read the UTF-8-encoded template file into the memory, and then convert it to an HTML file.
Note:
UTF-8 encoded files start with three additional Bytes: 0xef 0xbb 0xbf
A Unicode-encoded file starts with two additional Bytes: 0xff 0xfe
The use of require is as follows: require ("MyRequireFile. php ");. This function is usually placed at the beginning of the PHP program. Before the PHP program is executed, it will first read the file specified by require to make it a part of the
The best way:
Let's say something basic:
utf-8
Simplified Chinese
Traditional Chinese
American/Canadian English
Japanese
Han Wen
Russian
CODEPAGE specifies what IIS encodes to read the string passed over (form submission, address bar delivery,
After colleagues introduced the use of sublime Text, has been used very smoothly, but recently began to add some Chinese content in the document to become somewhat strange.
Later to the online search, we all said that with ConvertToUTF8 and GBK
Today in csdn see a PHP output blank stealth character 65279 problem, found on the Internet under, send this 65279 characters is PHP to mark the file is utf-8 encoded, the output will be output together to the client, resulting in the client if
PHP Invisible character 65279 (utf-8 BOM header) problem, 65279bom
Today in csdn see a PHP output blank stealth character 65279 problem, found on the Internet, sent under the 65279 character PHP is used to mark the file is UTF-8 encoded, output
This article mainly introduces the solution to the problem of invisible character 65279 in php, which is actually the BOM header of the UTF-8 file. This article provides a small program to delete the BOM header of the php file, for more information,
This article mainly introduces the solution to the problem of invisible character 65279 in php, which is actually the BOM header of the UTF-8 file. This article provides a small program to delete the BOM header of the php file, for more information,
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.