I have the following code:
$sql = \"update tbl_test set category = N\'resumé\';
echo $sql;
$rs=odbc_exec($conn,$sql);
Where $conn is a DS
If you are on Windows and running PHP 5.3, using PDO_ODBC with SQL Native Client, and your input text is UTF-8, this should just work automatically.
The problem was not ODBC, but PHP... solution was to use utf8_decode() on the strings returned from the database.
I would tread carefully here. In the past, when dealing with SQL Server and PHP integration, I have encountered cases where SQL Server uses between 3 and 5 times as much storage space as is actually needed for Unicode characters. Depending on how you connect to the database and how the data is encoded. My understanding is that MSFT is working on a new driver (or it has possibly been out for a while) that addresses the issue and generally improves PHP integration. With some of the older stacks, you might run into trouble. I recommend looking at the data size in the DB to verify that the connection is not padding your data.
Jacob