MySQL编码问题 [英] MySQL encoding issue

查看:140
本文介绍了MySQL编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,我的mysql表将单引号和双引号转换为奇怪的字符。例如

For some reason, my mysql table is converting single and double quotes into strange characters. E.g

"aha"

更改为:

“aha†

如何解决这个问题,或者在PHP中检测并解码所有内容?

How can I fix this, or detect this in PHP and decode everything??

推荐答案

您的mysql客户端和您的服务器的编码不匹配。使用 SET NAMES 匹配字符集连接到您的PHP文件中使用的。

The encoding of your mysql client and your server don't match. Use SET NAMES to match the character set of the connection to the one used in your PHP files.

这篇关于MySQL编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆