将 MySQL ANSI 输入转换为 UTF-8
我决定将我的网络应用程序从 ANSI 切换为 UTF-8。在 Notepad++ 中转换硬编码文件的编码(进行转换,不仅仅是更改字符集)并为 UTF-8 设置新的元标记后,我现在需要转换数据库数据。
该数据已以 ANSI 形式输入,但根据 phpMyAdmin 存储为 utf8_general_ci。显然我不能只改变 MySQL stocking 编码,因为它已经是正确的(显然?)。
在网页上,从数据库加载的重音字符(é、à 等)显示为 �。
I've decided to switch my web app from ANSI to UTF-8. After converting the encoding of my hardcoded files in Notepad++ (which does a conversion, not only changing the character set) and setting a new meta tag for UTF-8, I now need to convert my database data.
This data has been inputted on ANSI forms, but is stocked as utf8_general_ci according to phpMyAdmin. Obviously I can't just change the MySQL stocking encoding then, because it's already the right one (apparently?).
On the web pages, my accent characters (é, à, etc.) loaded from the DB appear as �.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我从这个博客中找到了解决方案< /a>:
但是,我在 phpMyAdmin 上收到 0 行受影响。知道为什么吗?
I think I found a solution from this blog:
However, I get 0 rows affected on phpMyAdmin. Any idea why?
有同样的问题,但是将 sql 连接更改为 utf-8 有帮助:)
Had the same problems, but changing the sql connection to utf-8 helped :)