mysql版本:mysql-4.1.21-win32.exe
apache版本:apache_1.3.37-win32-x86-no_src.msi
操作系统:winxp + sp2
php版本:php-4.4.3-win32.zip
我的网站目前要支持中、英文,以后还需支持其它语言。
所以我在创建数据库时都用了utf8
我使用了pear + smarty
php代码如下:
$user = db_dataobject::factory(''users'');
$user->query(select * from users where user_id=1);
$user->fetch();
$smarty->assign(''user'',$user);
$smarty->display(''index.tpl'');
模板文件:
nbsp; html public -//w3c//dtd xhtml 1.0 strict//en http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd>
6666
{$user->name}
但显示出来的是问号,英文的话就正常。
1.用phpmyadmin显示也能正常显示中文。
2.用命令提示符显示出来是乱码。
请问该如何解决此问题?谢谢。网上找了资料查看,但还是不行。
你的数据库里面存的是什么编码
数据库存为utf-8,还有在的同时,把文件也要保存为utf-8格式。。。
$user->query(set names utf8);
$user->query(&q