Colleagues code for the new added functionality, is pushed onto the server, login failures resulting in accident, fall back on previous versions, it can be used normally.
The only route.php uploaded files, system logon failure.
Comparative then used kdiff3 route.php two versions of the file, the file is found in the local route.php utf-8 with head bom
After using phpstorm batch convert file formats , to solve the problem
ctrl + A to select items
Next Right, or alt + F selected Remove BOM, so like
UTF-8 and has no BOM BOM distinction
BOM - Byte Order Mark, is a byte order mark
concept:
In UCS 编码
there is a "named ZERO WIDTH NO-BREAK SPACE
" character, its code is FEFF
. And FFFE
in UCS
the character does not exist, it should not appear in the actual transmission.
UCS specification suggested we transfer a byte stream before the first transmission character " ZERO WIDTH NO-BREAK SPACE
."
If the receiver is received FEFF
, it indicates that this is a big-endian byte stream; and if received FFFE
, it indicates the byte stream is of little endian. Therefore, the character " ZERO WIDTH NO-BREAK SPACE
" has been called BOM
.
effect:
UTF-8 BOM does not need to indicate the byte order, but may be used to indicate the encoding BOM. Character " ZERO WIDTH NO-BREAK SPACE
" of UTF-8编码
Shi EF BB BF
. So if the recipient to receive EF BB BF
byte stream beginning, I know this is UTF-8编码
a.
The impact of php
PHP in the design did not consider the issue BOM, that he will not ignore the three characters of the file begins with a BOM UTF-8 encoding.
COOKIE sent by the restriction mechanism, at the beginning of these files have been BOM's, COOKIE could not be sent (because sent before PHP has sent out the COOKIE header), that is, those who can not output the code prior to execution are invalid
Solution
Usually save the file as a
不带BOM的UTF-8
file