Edit report at https://bugs.php.net/bug.php?id=80874&edit=1
ID: 80874
User updated by: tony at tonymarston dot net
Reported by: tony at tonymarston dot net
Summary: odbc_fetch_array() will not fetch a row containing a
UTF-8 currency code symbol
Status: Open
Type: Bug
Package: ODBC related
Operating System: Windows 10
PHP Version: 7.4.16
Block user comment: N
Private report: N
New Comment:
No, I have not found a workaround for this problem. This means that I cannot use SAP HANA with my
multi-currency ERP application.
Previous Comments:
------------------------------------------------------------------------
[2021-09-06 09:35:18] jeremy dot galouye at gmail dot com
Hello, I had the same issue have you found a workaround solution ?
Thanks
------------------------------------------------------------------------
[2021-06-05 08:52:53] tony at tonymarston dot net
A developer at SAP has been investigating this problem and has discovered that the PHP odbc module
is not formatting the UCS-2 text correctly on Windows for the HANA ODBC driver. You can read his
full response at https://answers.sap.com/questions/13231775/hana-utf8-characters-being-garbled-when-using-the.html?childToView=13407210
------------------------------------------------------------------------
[2021-04-21 14:38:30] tony at tonymarston dot net
I do not know which driver is fault, so I have also reported this bug to the SAP HANA community at
https://answers.sap.com/questions/13322291/odbc-fetch-array-will-not-fetch-a-row-containing-a.html,
but as they have not tried accessing their database via PHP running on Windows they are unable to
reproduce this fault and there remain clueless.
I do not have the resources to try the same code using PHP on Linux, so I don't know if that
ODBC driver is any better. All I can say at the moment is that trying to access a SAP HANA database
from PHP is not a viable proposition.
------------------------------------------------------------------------
[2021-04-21 12:35:19] cmb@php.net
> These tests clearly show that the HANA ODBC driver mangles UTF8> values both when written and when read.
If it is the driver, there is not we can do about that, can't we?
------------------------------------------------------------------------
[2021-03-20 16:41:27] tony at tonymarston dot net
I have tried using the PDO ODBC driver both with and without the PDO::ODBC_ATTR_ASSUME_UTF8 option
with mixed results. I have also run tests by accessing the same data in a SQL Server database via
the PDO ODBC driver as a comparison.
I have captured the output from various tests which you can download from http://www.tonymarston.net/test-odbc-utf8.zip
TEST-1 uses the ODBC driver using data which was inserted using JDBC (the Eclipse plugin)
TEST-2 uses the ODBC driver using data which was inserted using PHP and the ODBC driver
TEST-3 uses the PDO-ODBC driver without the UTF8 attribute using data which was inserted using JDBC
TEST-4 uses the PDO-ODBC driver without the UTF8 attribute using data which was inserted using PHP
TEST-5 uses the PDO-ODBC driver with the UTF8 attribute using data which was inserted using JDBC
TEST-6 uses the PDO-ODBC driver with the UTF8 attribute using data which was inserted using PHP
These tests clearly show that the HANA ODBC driver mangles UTF8 values both when written and when
read.
The test using the PDO-ODBC driver with the UTF8 attribute turned ON produced the worst results as
it totally mangled all the non-UTF8 characters.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80874
--
Edit this bug report at https://bugs.php.net/bug.php?id=80874&edit=1