Bug #80778 [Fbk->Csd]: Cannot handle UTF8 characters when connected to a SAP HANA database

From: Date: Sun, 28 Feb 2021 11:33:55 +0000
Subject: Bug #80778 [Fbk->Csd]: Cannot handle UTF8 characters when connected to a SAP HANA database
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232432@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80778&edit=1

 ID:                 80778
 User updated by:    tony at tonymarston dot net
 Reported by:        tony at tonymarston dot net
 Summary:            Cannot handle UTF8 characters when connected to a
                     SAP HANA database
-Status:             Feedback
+Status:             Closed
 Type:               Bug
 Package:            ODBC related
 Operating System:   Windows 10
 PHP Version:        7.4.15
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

This bug is actually in a different extension.


Previous Comments:
------------------------------------------------------------------------
[2021-02-28 11:32:43] 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-23 10:49:48] 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-19 17:21:53] 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.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80778&edit=1


Thread (4 messages)

« previous php.bugs (#232432) next »