Home >Database >Mysql Tutorial >c++ 连接mysql 中文乱码_MySQL

c++ 连接mysql 中文乱码_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:34:511290browse

bitsCN.com

关于mysql编码问题的设置:

http://www.bitsCN.com/database/201108/101151.html

 

问题简述:

环境:linux

mysql编码设置:

终端插入中文,然后查看,不乱。

phpmyadmin插入中文,然后查看,不乱。

php连接 设置mysql_query("SET NAMES UTF8"),查看,由终端或phpmyadmin插入的都不乱。

唯一乱的是c++写进去的中文,全变乱码了。

解决:

c++里面数据库连接完了,加上

还不行,为啥呢?右键清空项目,再重新编译执行,不乱码了。

所以以后debug的时候记得清空项目后重新编译。

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn