---
title: "ci框架控制器中设置页面编码"
author: "mmdev"
date: "2010-12-29T20:07:00Z"
tags: []
slug: "ci"
draft: false
lastmod: "2011-11-11T12:55:28Z"
id: 1253495
url: "https://mmdev.iteye.com/blog/1253495"
---

如果页面出现乱码，常常需要设置页面的字符编码，CI框架，在控制器中，怎么设置呢，很简单代码如下：

$this-&gt;output-&gt;set\_header("Content-Type: text/html; charset=utf-8");