Click to See Complete Forum and Search --> : data output incorrectly


Shishio Makoto
09-13-2005, 09:15 PM
I have this code below:

<?php

include('adodb/adodb.inc.php');

$db_type='mysql';
$host='localhost';
$user='root';
$pass='password';
$database='music';

$conn = &ADONewConnection($db_type);
$conn->Connect($host,$user,$pass,$database);
$recordSet = &$conn->Execute("SELECT * FROM album;");

if (!$recordSet)
print $connect->ErrorMsg();
else
while (!$recordSet->EOF)
{
print $recordSet->fields[1].'<BR>';
$recordSet->MoveNext();
}
$recordSet->Close();
?>


My problem is my data in database is Vietnamese but when output it displays incorrectly like: "Đa" -> "?a", "Mỹ" ->"M?","Trường"->"Tr??ng"...

My input charset UTF-8 Unicode, MySQL charset UTF-8 Unicode, MySQL connection collation utf8_unicode_ci.

I'm using WinXP sp2:
Apache/2.0.54 (Win32), mod_ssl/2.0.54, OpenSSL/0.9.8, PHP/5.0.4, MySQL, phpMyAdmin 2.6.3-pl1.

NogDog
09-13-2005, 10:54 PM
Do you specify the charset for your HTML page? If not, be sure to include a meta tag something like this within the HEAD section of your page:

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

Shishio Makoto
09-13-2005, 11:13 PM
Yes, my HTML page included this line but it still won't work.