Skip to Content
1
Jan 23 at 03:30 PM

HANA - UTF8 characters being garbled when using the Windows ODBC driver

344 Views

I have installed SAP Hana Express Edition (virtual machine method) on my Windows PC so that I can use it with my PHP application. I have created a couple of databases and loaded data into several tables, and I can access these OK with my PHP application. EXCEPT when it comes to using UTF8 characters. I can create a record without error, but when I try and read it back I get nothing. When I view the data with an ODBC Query Tool the UTF8 characters have become garbled. When I view the same data in Eclipse they show up as garbled.

If I create the same record in Eclipse and view it in Eclipse the UTF8 characters are shown correctly.

Eclipse uses the JDBC driver whereas both the ODBC Query Tool and my PHP application use the Windows ODBC driver supplied by SAP, therefore it looks like the problem is with the Windows ODBC driver.

Note the following:

- all my string columns have been defined as NVARCHAR

- I have added CHAR_AS_UTF8=TRUE to the ODBC connection properties

- my ODBC driver version is 2.06.64.28100

Is there some other secret setting that I am missing?