I am using PHP function sybase_connect to connect to mssql database and retrieave data like this:
$mssql=sybase_connect($Host, $User, $Password, "cp1257");
$mssql->query("EXEC AuthLoginList");
while($mssql->get_row()){
echo $mssql->f('id')." ".$mssql->f('name')." ".$mssql->f('surname')."<br>";
}
However, national symbols are incorrectly extracted. Questionnaires appear in their place:
Database version is Microsoft SQL Server 2012 (SP4-GDR) (KB4583465) - 11.0.7507.2 (X64)
The following encodings are used for text fields:
It doesn't matter what encoding you use. The result is always the same. Question marks are provided instead of national symbols. Ex:
$mssql=sybase_connect($Host, $User, $Password, "cp1257");
$mssql=sybase_connect($Host, $User, $Password, "iso-8859-1");
$mssql=sybase_connect($Host, $User, $Password, "utf8");
$mssql=sybase_connect($Host, $User, $Password, "utf-8");
$mssql=sybase_connect($Host, $User, $Password, "iso_1");
$mssql=sybase_connect($Host, $User, $Password, "windows-1257");
$mssql=sybase_connect($Host, $User, $Password, "UNICODE");
Maybe someone could give me advice on how to solve this problem.
After a long reading of the TDS protocol documentation, I found a solution:
> export LANG lt_LT
By setting the environment variable LANG in this way, the MSSQL database in my nevironment obtains the correct encoding ISO-8859-13.