Home > Backend Development > PHP Tutorial > PHPStorm下调试使用CURL抓取数据中文乱码的一种可能

PHPStorm下调试使用CURL抓取数据中文乱码的一种可能

WBOY
Release: 2016-06-20 12:47:04
Original
1083 people have browsed it

最近在做CURL模拟登陆和获取数据时,在一个项目中CURL获取同一个网站数据,一个能够正常返回数据且编码正确,另一个项目中再怎么配置CURL都不正确。尝试着吧收到的内容用mb_convert_encoding从utf-8转到gb2312就正常了,多种尝试下估计是环境编码问题。检查文件编码:UTF-8,没问题,然后想起PHPStorm设置项里面有编码的设置,于是打开设置,搜索encod,找到File Encodings,检查IDE Encoding和Project Encoding是否是UTF-8,如果不是,请更改为想要的编码![设置](https://static.oschina.net/uploads/img/201510/12180754_Mt3R.png "在这里输入图片标题")
Copy after login

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template