简体   繁体   English

SQL Server-PHP无法识别特殊字符(ODBC)

[英]SQL Server - Special characters not recognise by PHP (ODBC)

I am trying to display some information from SQL Server to my PHP site. 我试图将一些信息从SQL Server显示到我的PHP站点。 I am using ODBC connection for that one. 我正在使用ODBC连接。

My Issue is : Special characters are not recognised and it is displaying "question mark (?)" in my site. 我的问题是:特殊字符无法识别,并且在我的网站上显示“问号(?)”。 (This works in my other ASP site) (这在我的其他ASP站点中有效)

What I am missing here ? 我在这里想念什么? Please help me. 请帮我。

Thanks in advance. 提前致谢。

I use some special MSSQL query converter and then ICONV in the PHP side like this: 我使用一些特殊的MSSQL查询转换器,然后在PHP端使用ICONV,如下所示:

   SELECT  CAST(Remarks AS TEXT) Remarks FROM r_table;

And in the PHP, say the text is in CodePage 1255: 在PHP中,说文本在CodePage 1255中:

   iconv('CP1255', 'UTF-8', $remark);

hope that's helps. 希望有帮助。

What's your character encoding for the ODBC connection? ODBC连接的字符编码是什么? It should be some UTF with proper handling on PHP side... 它应该是在PHP方面经过适当处理的UTF ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM