用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2059|回复: 3
收起左侧

[已解决] CI 2.1.1创建自己的类库出现乱码

[复制链接]
发表于 2012-6-29 15:05:08 | 显示全部楼层 |阅读模式
本帖最后由 yutian 于 2012-6-29 15:06 编辑

这个是我创建的类库
PHP复制代码
 
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
    class Common{
       
        function mytest()
        {
            echo "测试";
        }
       
    }
 
复制代码


控制器

PHP复制代码
 
<?php
 
    class Mytest extends CI_Controller{
       
        function __construct(){
            parent::__construct();
            $this->load->library('common');
        }
        function index(){
            $this->common->mytest();
        }
    }
 
复制代码

输出的内容如下
娴嬭瘯
问一下这个怎么解决

发表于 2012-6-29 17:11:34 | 显示全部楼层
文件编码与浏览器编码的问题
发表于 2012-7-1 21:27:22 | 显示全部楼层
文件编码换成utf-8编码, html的meta标签设置html的编码为UTF-8
发表于 2012-7-1 22:24:37 | 显示全部楼层
要写完整html才可以呀!不能只输出几个字符

本版积分规则