This question already has an answer here:
I have a php script that gets data from an SQL Server database. I have greek characters in that database and in order to be displayed correctly i have to do this:
function m($s){
return mb_convert_encoding($s,"UTF-8","ISO-8859-7");
}
echo m($row['name']);
in each string that i get from the database.
Is there a way to enforce UTF-8 conversion for any string in the script, without using a function?
</div>
I had to set charset for sql server connection like this:
This:
$connectionInfo = array( "Database"=>"myDB", "UID"=>"myuser", "PWD"=>"mypass","CharacterSet" => "UTF-8");
instead of this:
$connectionInfo = array( "Database"=>"myDB", "UID"=>"myuser", "PWD"=>"mypass");