2

I have tried for hours and cannot figure out how to insert a UTF-8 value into a SAP HANA database.

Is there some magic way to insert UTF-8 into HANA?

Instead of the actual UTF-8 string it inserts the utf8_encoded value 'å°è伿¥­æéå¬å¸'. But the string is already UTF-8.

$conn=odbc_pconnect("Driver=/usr/sap/hdbclient/libodbcHDB.so;
ServerNode=$servernode;Database=$database;DriverUnicodeType=1", $username, $pass, SQL_CUR_USE_ODBC);
$q="update mytable set native_name='專藝企業有限公司' where id=1234";
$ok=odbc_do($conn,$q);
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Steve Lloyd
  • 773
  • 2
  • 12
  • 33

1 Answers1

0

To store unicode characters, please change your Text column from varchar to NVARCHAR in the hana db and try. It should then work

Ref: https://archive.sap.com/discussions/thread/3290466

Senthil
  • 2,156
  • 1
  • 14
  • 19