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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 12:01:33 2024 UTC