UTF8与MySQL / PHP的困境(UTF8 woes with mysql/php)
我有一个导入数据的mysql表,特别是一个值是
Sinn Féin
。用于我的数据库的字符集是
utf8_general_ci
。 数据在phpMyAdmin中显示正常。 在我的网站中,我使用了PHP头部header("Content-type: text/html; charset='utf-8'");
。 我在<head>
有<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<head>
。我的数据仍然是
Sinn F in
。 我试过使用utf8_decode
,但这并没有帮助。 我究竟做错了什么?I've got a mysql table with some imported data, in particular one value is
Sinn Féin
.The character set used for my database is
utf8_general_ci
. The data displays fine in phpMyAdmin. In my site, I've used the PHP headerheader("Content-type: text/html; charset='utf-8'");
. I've got<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
in my<head>
.My data still comes up as
Sinn F�in
. I've tried usingutf8_decode
, but that doesn't help. What am I doing wrong?
原文:https://stackoverflow.com/questions/8616656
相关问答
更多-
Xdebug没有写入文件(Xdebug not writing to file)[2022-07-14]
事实证明,这一行: xdebug_start_trace('/home/dotancohen/xdebug'); 写入此文件: /home/dotancohen/xdebug.xt 因此, touch ~/xdebug.xt并将其修改为777即可解决问题。 It turns out that this line: xdebug_start_trace('/home/dotancohen/xdebug'); Writes to this file: /home/dotancohen/xdebug.xt ... -
您可以使用ssh将调试连接发送回客户端机器。 例如。 从你的客户端机器上连接到服务器,如下所示: ssh -R 9000:localhost:9000 you@example.com 然后启动您的(本地)调试器,并启动远程脚本。 Xdebug(在服务器上)现在将建立一个到它的localhost:9000的连接,但是由于这个端口被转发回到你的本地机器,你的(本地)调试器将接收到连接。 如果您在客户端使用Windows,则可以使用PuTTY执行相同的操作。 有关更多详细信息, 请参阅Spectator的文档 ...
-
所以eclipse和xdebug走进一个吧,然后我的apache服务器死了(So eclipse and xdebug walk into a bar, and then my apache server dies)[2021-11-09]
这篇文章听起来很有希望。 XDebug和Eclipse(在其php dev env中)可以通过事物的外观使用DBGp协议。 基于该文章,您可能可以通过混乱Apache的.htaccess文件或通过运行DBGp代理(无论如何)来使事情发生。 文章中的进一步细节。 我怀疑XDebug和Eclipse都连接到同一个PHP调试会话,彼此踩着脚趾,导致Hilarity to Ensue。 那个或者是“未定义的行为”。 无论哪种方式。 wooooooooooooo https://bugs.eclipse.org/bu ... -
好。 我有一个修复。 这很奇怪,但确实有效。 首先是我遗漏的一些背景(在我完全理解问题之前写的): 问题再次出现,实际上我认为这是在我将以下代码片段添加到错误位置后的第一次:
-
这可能是由您的zend_extension声明引起的。 如果您有空格或特殊字符,则应将该字符串包装在引号中 This is likely caused by your zend_extension declaration. If you have spaces or special characters you should wrap the string in quotes
-
我在使用filezilla的Windows机器上显示远程服务器。 我的Ubuntu 12.04目前尚未开启。 尝试建立与FTP服务器的连接。 是shure ftp启动并运行。 设置可以从本地计算机连接的ftp服务器。 将您的视角更改为Remote System explorer 。 Remote System explorer视图 创建一个新连接 测试你的ftp连接 Ftp服务器设置。 1为每个用户提供ftp访问权限,以创建系统用户。 2如果不存在该行 /斌/假 添加到/ etc / shells。 3在/ ...
-
发生这种情况是因为Eclipse PDT将php.ini复制到临时文件夹,而不包含相对conf.d文件夹中的内容(例如/etc/php5/cli/conf.d)。 这会导致您的扩展程序未正确加载。 我在stackoverflow上回答了这个问题:5784327 ,你可以查看那里提供的解决方案。 This happens because Eclipse PDT copies your php.ini to a temporary folder, without the contents in the rela ...
-
Eclipse和NetBeans PHP Xdebug会话永远不会完成(Eclipse and NetBeans PHP Xdebug session never completes)[2023-04-28]
我想也许找到了解决方案,问题是你删除了元数据: 当项目(包括源代码根目录)被删除或移出NetBeans并且NetBeans关闭时,则在NetBeans再次启动后,属于不再存在的源的行断点将被删除。 因此,恕我直言,在你的情况下,或者抛出了一些异常,这会中断断点消除,哪些会出现在你的messages.log文件中,或者你已经删除了没有源的项目元数据。 这是我能够重现您的问题的唯一案例: 1)创建一个Servlet2Stateless示例项目(或任何Java项目应该以这种方式工作恕我直言) 2)在“项目”窗口中 ... -
这是一个故意的错误。 PDT始终使用“-n”选项执行php。 它使得额外的ini文件不可用。 请参阅https://bugs.eclipse.org/bugs/show_bug.cgi?id=339547 另请https://bugs.eclipse.org/bugs/show_bug.cgi?id=347618 顺便说一句,你将能够添加一个shell脚本,它将“-n”选项修剪为PHP可执行文件。(首选项> PHP> PHP可执行文件) 例如, #!/bin/sh if [ $1 = "-n" ]; the ...
-
httpd无法加载xDebug:无法找到过程入口点(httpd fails to load xDebug: The procedure entry point could not be located)[2024-03-25]
您正在使用错误的二进制文件。 请参阅http://dedebug.org/wizard.php上的Xdebug向导,找出您需要的二进制文件。 You are using the wrong binary. Please refer to the Xdebug wizard at http://xdebug.org/wizard.php to find out which binary you need.