MySQL version: Mysql-4.1.21-win32.exe
Apache Version: Apache_1.3.37-win32-x86-no_src.msi
Operating system: WinXP + SP2
PHP Version: Php-4.4.3-win32.zip
My site is currently supported in both Chinese and English and will need to support other languages in the future.
So I used the UTF8 when I created the database.
I used the pear + Smarty
The PHP code is as follows:
$user = Db_dataobject::factory (' users ');
$user->query ("SELECT * from Users where user_id=1");
$user->fetch ();
$smarty->assign (' user ', $user);
$smarty->display (' Index.tpl ');
Template file:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" &G T
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>6666</title>
<body>
{$user->name}
</body>
But the question mark is displayed, the English word is normal.
1. The phpMyAdmin display can also display Chinese correctly.
2. Use the command prompt to display is garbled.
How can i solve this problem? Thank you. Look for information on the Internet, but still not.
What code is stored in your database?
The database is stored as utf-8, and in <meta http-equiv= "Content-type content=" text/html; Charset=utf-8 "/> At the same time, the file should also be saved as Utf-8 format ...
$user->query ("Set names UTF8");
$user->query (&q