本文介绍了Codeiginter MySQL将汉字存储为问号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入中文字符以存储在数据库中时,它变成???.问号代替.

When I type in chinese characters to store in the database, it becomes ??? question marks instead.

有人可以帮我吗?

我的字符集的codeigniter配置设置为

My codeigniter config settings for char set is

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

我的元标记也如下所示

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

推荐答案

当您尚未将表字符集设置为utf8时,就会发生此问题.检查表并将其Chartset设置为utf-8,并将排序规则设置为utf8_general_ci或utf8_unicode_ci(最适合您的语言:)).

This issue occur when you have not set the table charset to utf8. Check your table and set its Chartset to utf-8 and collation to utf8_general_ci or utf8_unicode_ci (which is best for your language :) ).

这将解决问题.

谢谢

这篇关于Codeiginter MySQL将汉字存储为问号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 23:44