php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43810 PDO ODBC windows-1250 data transfer
Submitted: 2008-01-10 20:31 UTC Modified: 2009-05-03 01:00 UTC
From: aszmyd at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.2.5 OS: Windows XP 32bit
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: aszmyd at gmail dot com
New email:
PHP Version: OS:

 

 [2008-01-10 20:31 UTC] aszmyd at gmail dot com
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&#261;, towarami przemys&#322;owymi. &#346;wiadczenie us&#322;ug w zakresie projektowania oraz realizacji inwestycji przemys&#322;owych i publicznych. Obr?t z zagranic&#261; towarami, technologiami i us&#322;ugami o znaczeniu strategicznym dla bezpiecze&#324;stwa Pa&#324;stwa.

Actual result:
--------------
echo "<td>".$zakres."</td>"
Handel zagraniczny i krajowy surowcami, energi&#261;, towarami przemys&#322;owymi. &#346;wiadczenie us&#322;ug w zakresie projektowania oraz realizacji inwestycji przemys&#322;owych i publicznych. Obr?t z zagranic&#261; towarami, technologiami i us&#322;ugami o znaczeniu strategicznym dla nym dla bezpiecze&#324;stwa &#377;&#262;&#323;[27 Pa&#324;stwa.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-29 17:50 UTC] aszmyd at gmail dot com
With odbc_connect, odbc_exec, odbc_fetch_row and odbc_result functions everything is OK.
Something is wrong with PDO functions.
 [2009-04-25 14:53 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 11:01:33 2025 UTC