utf8 for adodb to mssql issue

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
chan15
Forum Newbie
Posts: 1
Joined: Fri Sep 12, 2008 2:30 am

utf8 for adodb to mssql issue

Post by chan15 »

I use adodb odbc for php to connect ms sql server
and the field type in mssql server is already setting as nvarchar or ntext
and web page has declare the character set as utf8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

but the data become garbage character in both mssql and mysql database
I got the solution for mysql, revise the driver like this

if ($this->_connectionID === false) return false;

+ @mysql_query("SET NAMES 'utf8'", $this->_connectionID);

if ($argDatabasename) return $this->SelectDB($argDatabasename);
return true;

how to do the same thing in mssql connection?
Post Reply