I am using ODBC connection to access a SQL Server database and get string from it. The problem is that I get ? symbols in string where for example it should be ē.
This is the code I am using:
if(($result = odbc_exec($connect, $sql)) !== false) {
while( $obj = odbc_fetch_object( $result )) {
if ($obj->PLK_STATUSS == '10') {
echo $obj->DESCRIPTION;
}
}
}
It should echo Piemērs but what I get is Piem?rs.
I have put
<meta http-equiv="content-type" content="text/html; charset=utf-8"</meta>
in head. I also tried
echo utf8_decode($obj->DESCRIPTION);
with no luck.
What else could be a problem? I'm not experienced in php so probably it is something simple.
EDIT:
If I just do echo "Piemērs"; then it works.
EDIT: Im using FreeTDS to create ODBC connection. My guess is that problem is with ODBC configuration. From other sources I got that in freetds.conf file there should be line
client charset = UTF-8
But when I add this line web page stops working and I get ERR_EMPTY_RESPONSE in browser.