phpsql-serversql-server-2008-r2odbcdsn

Character Set issue using SQL Server and ODBC in php


I connected to to sqlsever2008 with odbc(with dsn) and php but problem is that when I retrieve information from that it has character like ���������. My datatype in sqlserver is nvarchar. Any idea why it is happening?

NOTE: The page is utf8.

Edit:

I use echo utf8_encode(odbc_result($this->result,'name') ); and characters are like:

ÂãæÒÔ ÒÈÇäÂãæÒ 

i retrieve information like this:

odbc_result($this->result,'name')


Solution

  • i found the problem.

    iconv("Windows-1256", "UTF-8", "$temp")