Ad

Euro Symbol Are Not Displayed When Pass From MSSQL To PHP

I'm passing data from MSSQL server to PHP using Laravel. After, I have to pass data back to save it in a database.

Strings which contain ‎€ symbol, display "?" instead of this symbol.

mb_detect_encoding($str) for strings without ‎€ symbol returns ASCII

Otherwise mb_detect_encoding($str) returns false. Therefore, json_encode($str) doesn't work and returns false as well.

mb_convert_encoding($str, 'UTF-8', 'ASCII'); returns a valid UTF-8 encoding.

So, I can run all the data which I'm getting from MSSQL trough this function to get UTF-8 but how should I pass it back? In UTF-8 encoding?

MSSQL Collation: SQL_Latin1_General_CP1_CI_AS, Laravel driver: sqlsrv

Ad

Answer

The problem was that PDO_sqlsrv wasn't enabled. Also, the problem is that by default SqlServerConnector.php using pdo_dblib driver instead of pdo_sqlsrv in Laravel 5.5. The priority was changed in the later versions.

Links helped me:

Ad
source: stackoverflow.com
Ad