php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79059 PDO ODBC removes strings with encoded chars from results retrieved from IBM i
Submitted: 2020-01-03 10:34 UTC Modified: -
From: mdalco at gmail dot com Assigned:
Status: Open Package: PDO ODBC
PHP Version: 7.3.13 OS: Linux Centos 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-01-03 10:34 UTC] mdalco at gmail dot com
Description:
------------
If I update the IBM iAccess driver to the last version (iaccess 1.1.0.12) on my server, I can no longer retrieve text data that include encoded chars (e.g. àèìòù and other).
The query just runs and retrieves the row, but the fields containing a non ASCII char are empty.

If I try to execute the same query with the isql unixODBC utility everything works fine:

SQL> SELECT CLCCLI, CLDRSO FROM $$LIBFA0.CLIEN01L WHERE CLCCLI=31
+---------+-------------------------------+
| CLCCLI  | CLDRSO                        |
+---------+-------------------------------+
| 31      | S.A.DES EAUX MINÉRALES D'EVIA|
+---------+-------------------------------+
SQLRowCount returns -1
1 rows fetched

From PHP:

$connection = new PDO('odbc:AS400', $user, $password);
$result = $connection->query('SELECT CLCCLI, CLDRSO FROM $$LIBFA0.CLIEN01L WHERE CLCCLI=31');
while($row = $result->fetch(PDO::FETCH_ASSOC))
   print_r($row);

Output:

Array
(
    [CLCCLI] => 31
    [CLDRSO] =>
)

If I switch back to an older version of i access driver (iSeriesAccess 6.1.0) everything works fine, and the same previous script outputs:

Array
(
    [CLCCLI] => 31
    [CLDRSO] => S.A.DES EAUX MINÉRALES D'EVIA
)

isql works fine with both drivers.




Test script:
---------------
$connection = new PDO('odbc:AS400', $user, $password);
$result = $connection->query('SELECT CLCCLI, CLDRSO FROM $$LIBFA0.CLIEN01L WHERE CLCCLI=31');
while($row = $result->fetch(PDO::FETCH_ASSOC))
   print_r($row);


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Feb 18 01:01:26 2020 UTC