Icon View Incident Report

Serious Serious
Reported By: Uli Becker
Reported On: 6/16/2012
For: Version 2.08 Build 3
# 3599 Unicode PHP Extension Not Returning Data in Correct UTF-8 Format

I'm using the Unicode PHP extension with a database containing German and Kyrillic characters, and getting garbled data back from the following script. I tried html-headers with charset-settings, but nothing changed.

<?php
header('Content-type: text/html; charset=utf-8');
if (!extension_loaded('edb'))
{
   dl('php_edb.dll');
}

$con = edb_connect("type=local;configpath=C:\\unicode;database=Uli32;uid=Administrator;pwd=EDBDefault");
if (!$con)
  {
  die("Could not connect: " . edb_errmsg());
  }

echo "ConfigPath: " . edb_connset($con,"configpath") . "<br>";
echo "Databasename: " . edb_db($con) . "<br>";

$cmd = edb_prepare($con,"SELECT FirstName, LastName, Phonenumber FROM AddressBook");
$cursor = edb_execute($cmd);

echo "Number of Columns: " . edb_colcount($cursor) . "<p>";

echo "<table border=\"1\" cellpadding=\"3\">";
echo "<tr>";

for ($i = 0; $i < edb_colcount($cursor); $i++)
{
$colinfo = edb_colinfo($cursor,$i);
echo "<td>" . $colinfo["Name"] . "</td>";
}
echo "</tr>";

while (!edb_eof($cursor)):
   echo "<tr>";
   for ($i = 0; $i < edb_colcount($cursor); $i++)
      {
      $col = edb_getcol($cursor,$i);
      if (is_null($col))
         echo "<td>NULL</td>";
      else
         echo "<td>" . $col . "</td>";
      }
   echo "</tr>";
   edb_next($cursor);
endwhile;

echo "</table>";
edb_disconnect($con);

?>



Comments Comments
The Unicode PHP extension was not returning data in the correct UTF-8 format. The manual has also been updated to include a new section on character sets.


Resolution Resolution
Fixed Problem on 7/22/2012 in version 2.09 build 1


Products Affected Products Affected
ElevateDB PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial

Image