Bug #79059 [NEW]: PDO ODBC removes strings with encoded chars from results retrieved from IBM i

From: Date: Fri, 03 Jan 2020 10:34:30 +0000
Subject: Bug #79059 [NEW]: PDO ODBC removes strings with encoded chars from results retrieved from IBM i
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224683@lists.php.net to get a copy of this message
From: mdalco at gmail dot com Operating system: Linux Centos 7 PHP version: 7.3.13 Package: PDO ODBC Bug Type: Bug Bug description:PDO ODBC removes strings with encoded chars from results retrieved from IBM i 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); -- Edit bug report at https://bugs.php.net/bug.php?id=79059&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79059&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79059&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79059&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79059&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79059&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79059&r=support Expected behavior: https://bugs.php.net/fix.php?id=79059&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79059&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79059&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79059&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79059&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79059&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79059&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79059&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79059&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79059&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79059&r=mysqlcfg

« previous php.bugs (#224683) next »