Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
441 views
in Technique[技术] by (71.8m points)

有没有什么办法过滤掉数据库中的乱码?

发现数据库中有一部分信息变成了中文乱码
下面这种情况

娌挎捣鍥介檯涓績 网页设计

php或js有么有办法获取到这个字段的内容并检测出它包含乱码呢?

现在想知道有没有办法可以匹配到这些乱码(检测字符串中含有乱码)

感谢回答!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以在数据库内部设置这个库的字符编码为UTF-8
alter database 数据库名 character set utf8;


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...