【问题标题】:Displaying UTF8 Character on Codeigniter在 Codeigniter 上显示 UTF8 字符
【发布时间】:2013-05-30 04:54:57
【问题描述】:

配置.php

$config['charset'] = 'UTF8';

数据库.php

$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';

html 标头

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

我的数据库有 utf8_general_ci 的排序规则,我的所有文件都使用 utf8 编码,即使我无法在我的页面上显示我的 unicode 字符

这总是显示 वि.सं。 २०१४ सालमा

【问题讨论】:

  • php.ini 中是否启用了 UTF-8?另外,如果我没记错的话,$config['charset'] 应该设置为 'UTF-8' 而不是 'UTF8'。
  • 您是否在 HTML 页面中设置字符集 ? &lt;meta charset="utf-8"&gt;

标签: php codeigniter codeigniter-2


【解决方案1】:

你需要确保你到处都有 utf8,比如 在 config.php 中

$config['charset'] = "UTF-8"; //not UTF8

在 php.ini 中

default_charset = "utf-8"

用于数据库

DEFAULT CHARSET=utf8;

【讨论】:

  • 非常感谢您,先生...尼泊尔语 ma text na aayera 最后的张力 bhako thiyo... :)
  • 呵呵,很高兴知道它对你有用...是的,dimaag kharaab garney issue yestai ho .. 简单的 cha 但很容易跳过 huncha dimaag baata.. :)
  • 请@Sld G'tam English
猜你喜欢
  • 2013-06-09
  • 2023-03-17
  • 2011-10-31
  • 2014-11-04
  • 2014-02-12
  • 1970-01-01
  • 2013-05-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多