Sc_select problem to returm string with Greek Characters

Hi,

I have spent the last two days to find out the solution but not. So, i am trying the Forum for first time.

The problem is when i use the sc_select and try to “echo” a specific field (K_Type) i get the �������� as return which is Greek characters into DB.

If I run the same query into SQL Builder I get the Greek characters correctly.

The php code is

$check_sql = “SELECT TOP 1 K_Callie, K_Date, K_Time, K_Car, K_Type, K_Driver”

. " FROM vResApi"

. " WHERE K_Car = 'KWD439";

sc_select(rs, $check_sql);

echo $rs->fields[4]; //which return the ��������

My Scriptcase version is 9.4.018

Professional Edition Bronze MSSQL

Windows Installation

Any suggestion will appreciated.

Regards,

Hi you solved this is problem I see same problem if have any result share. with me plase

The problem is that the charset of the database is not the same of your SC app

To fix this you need to cast it yourself, like this (this is for mySQL, it may have to be adapted for MSSQL)

SELECT field1, field2, field3, convert(cast(field4 as binary) using latin1) FROM table

I don’t know your setup so instead of latin1 (I use it for French) you may have to use ut8 or something else that will match your requirement

Yes i solved this problem.

In file \scriptcase\prod\third\adodb\drivers\adodb-mssqlnative.inc.php
find funtion name “function _connect”
add thisline
$connectionInfo[‘CharacterSet’] = ‘UTF-8’;
and the end of the parameters

1 Like