Today, I encountered a php curl data garbled problem.
Neither gzip nor encoding settings
At last, a colleague determined that utf8 + bom was the reason for saving the data. He was too lazy to understand utf8 + bom in depth and only recorded the data.
[root@centos5 ~]# curl -s http: ef bb bf 3c 4f 6d || 6c 4c 2d 2f 2f |l PUBLIC 2f 2f 4d 4c 2e | 6e 6f 6e 6c 2f 2f 4e |Transitional 3a 2f 2f 2e | http: 2e 6f 2f 2f 6d 6c 2f |.org/TR/xhtml1/D| 2f 6d 6c 2d 6e |TD/xhtml1-transi| 6f 6e 6c 2e 3e 0d 0a |tional.dtd~]# curl -s http: ef bb bf |...|
~]# curl -s http: ef bb bf 3c 4f 6d || 6c 4c 2d 2f 2f |l PUBLIC 2f 2f 4d 4c 2e | 6e 6f 6e 6c 2f 2f 4e |Transitional 3a 2f 2f 2e | http: 2e 6f 2f 2f 6d 6c 2f |.org/TR/xhtml1/D| 2f 6d 6c 2d 6e |TD/xhtml1-transi| 6f 6e 6c 2e 3e 0d 0a |tional.dtd
After converting the curl to the hexdump format, the normal utf8 format is |... <! DOCTYPE htm | start
Utf8 + bom:
Memo
Http://huoding.com/2011/05/14/78:
Finally, ask the other technical staff to convert the file into utf8 and save it to solve the problem.