在windows在安装FreeTDS,让mssql支持UTF-8

作者 : admin 于 2008-07-22 15:27:47 标签: , , ,
2008
07-22

本人有个项目使用php+mssql,而mssql只支持gb2312和utf-16编码,而php又要求使用utf-8编码,想到了freetds.而freetds是个在unix下开发的工具,我下载freetds最新版后,发现里边有windows下的编译脚本,在DEV-C++里进行编译后,不支持,后又从鬼子论坛里找到达人编译好的组件,安装配置后,正常,大喜。

; Specify client character set.
; If empty or not set the client charset from freetds.comf is used
; This is only used when compiled with FreeTDS
mssql.charset = “UTF-8″

在php.ini里设置这里,即可让FreeTDS生效。This is only used when compiled with FreeTDS。mssql默认是不支持设置字符集的,只有安装freetds的时候才能生效。

其实,PHP官方早就在系统里留出了freetds的接口,windows下的PHP.INI文件就为freetds留出接口参数。

在linux下,编译php的时候,有这样的日志

configure:68696: checking whether to enable pcntl support
configure:69264: checking whether to enable PDO support
configure:69689: checking for PDO_DBLIB support via FreeTDS
configure:70399: checking for Firebird support for PDO

在linux下,同样为php留出了接口

评论 4

  1. php800 Says:

    是否可以给个mssql支持UTF-8的freetds.dll
    email flygps@139.com

  2. php Says:

    楼主好,我也碰到一样的问题了,能否帮忙发一个WINDOWS下的PHP用的FreeTDS.dll,不胜感激。
    邮件:mumaren@21cn.com

  3. sky Says:

    楼主好,我也碰到一样的问题了,能否帮忙发一个WINDOWS下的PHP用的FreeTDS.dll,不胜感激。
    邮件:zsb1978@yahoo.com.cn

  4. joe Says:

    樓主 可否也發一個 freetds.dll 給我

    joe09827575@yahoo.com.tw

发表评论




XHTML:你可以使用的标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(若看不到验证码,请重新加载页面。)