`
阿尔萨斯
  • 浏览: 4107168 次
社区版块
存档分类
最新评论

关于file_get_contents读取http乱码问题

 
阅读更多
今天从早上弄到现在也没解决~~~~这里我想先谈一下这个 file_get_contents

今天为了解决乱码问题,我又把精华帖子里面的看了一遍了~~之前我也遇到一次~~那次是因为phpmyadmin的版本不同导致乱码,也费了我不少时间才解决。

废话不多说了~~现在我想问的是 file_get_contents默认的获取方式是utf8~~~我测试了一下,读取utf8网页正常

但是读取gb2312或者gbk就全乱了~~~~我想这不再是精华帖子里面那一些网页和数据库之间编码不同导致的问题了。

手册上(If unicode semantics are enabled, the default encoding of the read data is UTF-8. You can specify a different encoding by creating a custom context or by changing the default using stream_default_encoding()).

可是你可以去查一下 根本就没有 stream_default_encoding()这个函数。

现在我最想知道file_get_contents()默认的读取编码可以改变吗????
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics