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

发布于 2024-09-12 06:51:38 字数 153 浏览 1 评论 0原文

我正在尝试将一些信息从 SQL Server 显示到我的 PHP 站点。我正在使用 ODBC 连接。

我的问题是:无法识别特殊字符,并且在我的网站中显示“问号(?)”。 (这适用于我的其他 ASP 站点)

我在这里缺少什么?请帮我。

提前致谢。

I am trying to display some information from SQL Server to my PHP site. I am using ODBC connection for that one.

My Issue is : Special characters are not recognised and it is displaying "question mark (?)" in my site. (This works in my other ASP site)

What I am missing here ? Please help me.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

流星番茄 2024-09-19 06:51:38

我使用一些特殊的 MSSQL 查询转换器,然后在 PHP 端使用 ICONV,如下所示:

   SELECT  CAST(Remarks AS TEXT) Remarks FROM r_table;

在 PHP 中,假设文本位于 CodePage 1255 中:

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

希望有帮助。

I use some special MSSQL query converter and then ICONV in the PHP side like this:

   SELECT  CAST(Remarks AS TEXT) Remarks FROM r_table;

And in the PHP, say the text is in CodePage 1255:

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

hope that's helps.

青春有你 2024-09-19 06:51:38

ODBC 连接的字符编码是什么?
它应该是一些在 PHP 端进行适当处理的 UTF...

What's your character encoding for the ODBC connection?
It should be some UTF with proper handling on PHP side...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文