首页 \ 问答 \ UTF8与MySQL / PHP的困境(UTF8 woes with mysql/php)

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 header header("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 using utf8_decode, but that doesn't help. What am I doing wrong?


原文:https://stackoverflow.com/questions/8616656
更新时间:2022-05-09 22:05

相关问答

更多
  • 事实证明,这一行: 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的文档 ...
  • 这篇文章听起来很有希望。 XDebug和Eclipse(在其php dev env中)可以通过事物的外观使用DBGp协议。 基于该文章,您可能可以通过混乱Apache的.htaccess文件或通过运行DBGp代理(无论如何)来使事情发生。 文章中的进一步细节。 我怀疑XDebug和Eclipse都连接到同一个PHP调试会话,彼此踩着脚趾,导致Hilarity to Ensue。 那个或者是“未定义的行为”。 无论哪种方式。 wooooooooooooo https://bugs.eclipse.org/bu ...
  • 好。 我有一个修复。 这很奇怪,但确实有效。 首先是我遗漏的一些背景(在我完全理解问题之前写的): 问题再次出现,实际上我认为这是在我将以下代码片段添加到错误位置后的第一次:
                
                
    这被添加到以下代码(由David Powers从PHP Solutions复制)到之前的位置 标签而不是之后: < ...
  • 这可能是由您的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 ...
  • 我想也许找到了解决方案,问题是你删除了元数据: 当项目(包括源代码根目录)被删除或移出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 ...
  • 您正在使用错误的二进制文件。 请参阅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.

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)