Ec (2); MySQL version: mysql-4.1.21-win32.exe & nbsp; Apache version: apache_1.3.37-win32-x86-no_src.msi & nbsp; Operating System: WinXP & nbsp; + & nbsp; SP2 & nbsp; & nbsp; PHP version: php-4.4.3-Win32.zip & nbsp; "script" ec (2); "script"
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 website must support both Chinese and English, and other languages in the future.
So I used utf8 when creating a database.
I used 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:
6666
{$ User-> name}
However, if the question mark is displayed, it is normal in English.
1. You can also use PHPMyAdmin to display Chinese characters normally.
2. garbled characters are displayed at the command prompt.
How can I solve this problem? Thank you. I found information on the Internet, but it still does not work.
What encoding is stored in your database?
The data inventory is UTF-8, and At the same time, save the file as UTF-8 format...
$ User-> query ("set names utf8 ");
$ User-> query (& q
<