I am trying to fetch our Arabic values from JDE Database using the following connection string:
$dsn = "Driver={SQL Server};Server=10.10.10.27;Database=JDE;charset=utf8";
$username = "username";
$password = "password";
$string = "odbc:".$dsn.";Uid=".$username.";Pwd=".$password.";";
$con = new PDO($string);
As you can see I have the charset=utf8 specified.
I also have my HTML meta present:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
I also have used arabic characters fetched from MySQL before and it is displayed correctly and I can see Arabic characters, but from JDE database I get the following:
name: ??? ???? ???? ??? ??? ??? ???? ???? ??? ???
I tried adding the following in my php code trying different output:
echo iconv('windows-1256', 'utf-8', $DataFromJDE);
echo utf8_decode($DataFromJDE);
echo utf8_encode($DataFromJDE);
But all failed.
Is there a configuration I need to do on the server?
I am using Apache with PHP 7 on a Windows server.
The JDE is in a separate server.
What am I missing? Is it from PHP or JDE?