I have PHP talking to SQLServer through ODBC using FreeTDS and unixODBC. I followed tutorials to get this setup. It's working fine now although special characters in the database are not showing up correctly. Specifically, the ™ symbol. It's showing up in the browser as �. I've tried setting client charset = UTF-8
in the [global] section of freetds.conf. I've tried iconv('UCS-2', 'UTF-8', $str)
and mb_convert_encoding($str, 'UTF-8', 'UCS-2')
within PHP and both result in asian character sets (䐧祲圠攮戮餮吠渭捥❫
). I'm stumped! Anyone have any tips?
One other element that bears mentioning: When I run this code on my local machine, I don't have these issues. The ™, for example, shows up fine. My local machine is a mac and I'm using Actual Technologies ODBC driver. Where I'm having trouble is our LAMP webserver. This leads me to believe that problem lies in the driver configuration. Or possibly linux as whole needs to be informed of UTF-8?