0

I have recently installed a SAP HANA virtual machine on one of my Windows PCs and can connect to it using my PHP application and the Eclipse plugin. I have created several databases and can read from and write to them from my application, but I have hit two problems:

  1. It does not handle UTF8 characters correctly.
  2. It randomly shifts some text strings to uppercase.

My PHP version is 7.4.14 and the HDBODBC driver version is 2.06.64.28100.

When I examine the data using Eclipse it is exactly as it should be, but when I retrieve it through PHP it exhibits the above problems. I have also used another 3rd party ODBC Query Tool which uses the same HDBODBC driver and it suffers from the same problems, so I know that it's not a PHP problem.

Does anyone have any ideas?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • 1
    Maybe this [answer](https://stackoverflow.com/questions/47392027/diag-s1000-sap-aglibodbchdb-sohdbodbc-general-error-10427-conversion-of) could help you (set the `CHAR_AS_UTF8 = true` connection option). No idea for random upper case. – Sandra Rossi Feb 04 '21 at 18:42
  • I have already tried that, but it does not make any difference. – Tony Marston Feb 05 '21 at 19:20
  • It may help if the question contained more details on the specific error and a reproduction example. Also, creating ODBC traces might be another way to gain more details around what data types get bound for the UTF-8 data. – Lars Br. Feb 17 '21 at 23:47
  • I have 3 ways of accessing data in the HANA database: – Tony Marston Feb 19 '21 at 16:26
  • All the text fields in the database are NVARCHAR, so should be able to contain UTF8 characters. I can access the database in 3 ways: 1) The Eclipse plugin, which uses the JDBC driver. 2) A 3rd party ODBC Query Tool. 3) My PHP application. I inserted data using Eclipse, and the value ‘Neuchâtel’ shows up correctly in Eclipse. When I view the same data with the Query Tool it shows up as ’Neuchâtel’. If I input the data using PHP it shows up in Eclipse as ’Neuchâtel’. – Tony Marston Feb 19 '21 at 16:49

0 Answers0