AnsweredAssumed Answered

Thai characters are unreadable in fox pro dbf issue

Question asked by win win on Sep 27, 2014
I am using sugarcrm 6.5.17 CE edition and logic hook to do sql transactions with fox pro dbf database.
The issue is that Thai characters are unreadable when they are inserted into the dbf.
For example, when I use a dbf viewer tool to see the records, the updated column shows unreadable chars ,"เธ", which is supposed to be "ห". 

As you can see in the following logic hook class, I use odbc of php to connect and updated the dbf database.
I have also tried setting CHARSET=windows-874 or collate=Thai in connection string, but it did not work.
Could you please help?

class AccountsHookClass{
  function before_save_method($bean, $event, $arguments)
    $dsn = "Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDB=C:\\xampp\\htdocs\\sugarcrm\\ARMAS.DBF;Exclusive=NO;collate=Machine;NULL=YES;DELETED=YES;BACKGROUNDFETCH=NO;";
    $odbc = odbc_connect($dsn, "", "");
$sql = "UPDATE C:\\xampp\\htdocs\\sugarcrm\\ARMAS.DBF 
    WHERE CUSCOD = '$key';";
$result = odbc_exec($odbc, $sql) or die (odbc_errormsg());

Thank you.