今天项目页面乱码
我确认了数据库读取时utf8,页面也添加
<meta http-equiv=”content-type” content=”text/html; charset=UTF-8″ />
再确定程序页面编码同样是utf-8!!!!!!可以页面依旧乱码。~~~
其实我看服务器的response
Content-Type:text/html; charset=gb2312
我看到了不想看的内容!!!!!
忽然想起ci的output类找代码看看set_content_type和set_header
我在我控制集成的父类添加了
$this->output->set_header(“Content-Type: text/html; charset=utf-8”);
这样就解决了问题!