From: [EMAIL PROTECTED]
Operating system: Win2k
PHP version: 4.2.2
PHP Bug Type: *Languages/Translation
Bug description: Unicode (Slovenian) characters are not displayed correctly
The problem is with Microsoft SQL Server 2000 and with MySQL version Ver
11.18 Distrib 3.23.52, for Win95/Win98 (i32).
I have a database with slovenian characters in the fields and I am not
able to display them properly with php extension modules. I can display
them propery using COM ADO objects. I've included a simple script, that
shows what I am trying to do. The ADO portion of the script produces the
desired result. The characters are entered using windows-1250 codepage.
The script:
<PRE><?
header("Content-Type", "text/html; charset=Windows-1250");
?>
<html><head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1250">
</head>
<body>
<?
$conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$conn->Open("PROVIDER=MSDASQL;DRIVER={SQL SERVER};
Server=SRRDEV2;Database=portal;UID=sa;PWD=srrdev2;");
// SQL statement to build recordset.
$rs = $conn->Execute("SELECT * FROM TblInfo_News where IID = 3034326");
while (!$rs->EOF) {
$fv = $rs->Fields("title");
echo "title: ".$fv->value."<br>\n";
$rs->MoveNext();
}
$rs->Close();
?>
PHP Mssql extension:<br>
<?
$link = mssql_connect("srrdev2.mobitel.si", "sa", "srrdev2");
if($link) {
if(mssql_select_db("portal", $link)) {
$query = "SELECT * FROM TblInfo_News where IID = 3034326";
$result = mssql_query($query, $link);
if($result) {
if(mssql_num_rows($result)) {
while($row = mssql_fetch_array($result)) {
echo "title: " . $row['title'] .
"<BR>";
}
} else {
echo "No results! <BR>";
}
mssql_free_result($result);
} else {
echo "Could not get the result!<BR>";
}
mssql_close($link);
} else {
echo "Could not select db!<BR>";
}
} else {
echo "Could not connect!<BR>";
}
// mysql
echo "MYSQL<BR>";
$link = mysql_connect("valencicm.mobitel.si", "root", "root")
or die("Could not connect");
mysql_select_db("test");
$query = "SELECT * FROM tbl1";
$result = mysql_query($query);
if($result) {
$row = mysql_fetch_array($result);
if($row) {
echo "String: " . $row['fld1'];
}
mysql_free_result($result);
}
mysql_close($link);
?>
</body></PRE>
--
Edit bug report at http://bugs.php.net/?id=20166&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20166&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20166&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20166&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20166&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20166&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20166&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20166&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20166&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20166&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20166&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20166&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20166&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20166&r=isapi