From: aszmyd at gmail dot com
Operating system: MS Win XP 32
PHP version: 5.2.5
PHP Bug Type: PDO related
Bug description: PDO ODBC windows-1250 data transfer
Description:
------------
Problem with long text transfer in code page windows-1250 (polish
characters).
When text is longer then 256 characters some unexpected characters appear
at the end of it.
Text without polish characters is OK.
Text with polish characters after 256 character is also OK.
Data are retrieved from Progress 10.1A data base through ODBC driver.
Transfering data to MS Excel gives perfect results.
Reproduce code:
---------------
$dsn = "odbc:DSN=soja;PWD=xyz";
$dbh = new PDO($dsn);
$sql = 'SELECT
certyfikaty.nr_certyfikatu,
certyfikaty.zakres,
firmy.nazwa_firmy
FROM PUB.certyfikaty, PUB.firmy
WHERE certyfikaty.id_firmy = firmy.id_firmy;
$stmt = $dbh->prepare($sql);
$stmt->execute();
$stmt->bindColumn(1, $nr_certyfikatu, PDO::PARAM_STR, 16);
$stmt->bindColumn(2, $zakres, PDO::PARAM_STR, 512);
$stmt->bindColumn(3, $nazwa_firmy, PDO::PARAM_STR, 64);
while ($row = $stmt->fetch(PDO::FETCH_BOUND)){
echo "<td>".$nr_certyfikatu."</td>";
echo "<td>".$nazwa_firmy."</td>";
echo "<td>".$zakres."</td>";
echo "</tr>";}
$dbh = null;
Expected result:
----------------
echo "<td>".$zakres."</td>"
Handel zagraniczny i krajowy surowcami, energią, towarami
przemysłowymi. Świadczenie usług w zakresie projektowania
oraz realizacji inwestycji przemysłowych i publicznych. Obrót z
zagranicą towarami, technologiami i usługami o znaczeniu
strategicznym dla bezpieczeństwa Państwa.
Actual result:
--------------
echo "<td>".$zakres."</td>"
Handel zagraniczny i krajowy surowcami, energią, towarami
przemysłowymi. Świadczenie usług w zakresie projektowania
oraz realizacji inwestycji przemysłowych i publicznych. Obrót z
zagranicą towarami, technologiami i usługami o znaczeniu
strategicznym dla nym dla bezpieczeństwa ŹĆŃ[27
Państwa.
--
Edit bug report at http://bugs.php.net/?id=43810&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43810&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43810&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43810&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43810&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43810&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43810&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43810&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43810&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43810&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43810&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43810&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43810&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43810&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43810&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43810&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43810&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43810&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43810&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43810&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43810&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43810&r=mysqlcfg