php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80778 Cannot handle UTF8 characters when connected to a SAP HANA database
Submitted: 2021-02-19 17:21 UTC Modified: 2021-02-28 11:33 UTC
From: tony at tonymarston dot net Assigned: cmb (profile)
Status: Closed Package: ODBC related
PHP Version: 7.4.15 OS: Windows 10
Private report: No CVE-ID: None
 [2021-02-19 17:21 UTC] tony at tonymarston dot net
Description:
------------
I am running PHP 7.4.15 on Windows 10 and have connected to a SAP HANA database using the ODBC driver. The HDBODBC version is 2.07.21 and I have added CHAR_AS_UTF8=TRUE to the ODBC connection properties. I use the Eclipse plugin, which uses JDBC, as the tool to manage my databases. I have the same databases available in MySQL, Oracle and SQL Server and those can deal with UTF8 characters, but HANA does not seem to like them at all. If I input the string 'Neuchâtel' using Eclipse it shows up in PHP as 'NEUCHâTEL'. If I update the value in PHP and then retrieve it, it shows up as 'NEUCHâTEL'. Note that while Eclipse shows them as mixed case strings in PHP they are all shifted to upper case.

Expected result:
----------------
I expect the ODBC driver to both read and write UTF8 characters properly, and not shift everything to uppercase when reading them.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-23 10:49 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-23 10:49 UTC] cmb@php.net
Please provide a *minimal* reproduce script, and the according
ODBC backtrace[1]?

[1] <https://docs.oracle.com/cd/E17952_01/connector-odbc-en/connector-odbc-configuration-trace-windows.html>
 [2021-02-28 11:32 UTC] tony at tonymarston dot net
I have tried for ages to produce a minimal script which produces this error but I am having great difficulty in doing so. Not only does this involve reading a record from the database, but it also involves inserting that data into an XML document, then transforming it into HTML using an XSL stylesheet.

Apart from using a different Data Access Object for each RDBMS all the other code in my application is exactly the same. When I read and display data from a MySQL or SQL Server database the results are consistently correct, but when I read exactly the same data from a SAP HANA database the value 'Neuchâtel' is somehow being consistently converted to 'NEUCHâTEL'. Stepping through the code with my debugger has revealed that the DAO for SAP HANA does in fact retrieve the value 'Neuchâtel' and that it is somewhere in the XML/XSL processing that it is being changed.

I shall therefore close this bug report and open a new one on the relevant extension.
 [2021-02-28 11:33 UTC] tony at tonymarston dot net
-Status: Feedback +Status: Closed
 [2021-02-28 11:33 UTC] tony at tonymarston dot net
This bug is actually in a different extension.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 17:01:31 2024 UTC