php - 网页中文乱码无法解决,见图
伊谢尔伦
伊谢尔伦 2017-05-16 13:10:16
0
9
718

在别的电脑上弄好了,显示正常,转到自己电脑就成这样了
文件编码是utf-8,页面也已设置<meta charset="utf-8">,数据库编码也是utf8,究竟是哪里问题呢

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(9)
迷茫

Try adding mysql_query("SET NAMES UTF8");? Or check the encoding settings of the database through the command line: show variebles like "character_set_%"; focus on whether the values ​​​​of "character_set_client", "character_set_connection", and "character_set_results" are all set to utf8

给我你的怀抱

Check whether the relevant folder names are in Chinese

習慣沉默

Sometimes the encoding format written in the program is UTF-8, but garbled characters appear when displayed. The reason may be related to the editor. Some editors on Windows have certain problems. It is recommended to change the compiler and try again

某草草

Check the database connection form to see if it is utf-8

習慣沉默

You did not select the encoding when importing the data, and the data imported into the database is already garbled

大家讲道理

header("Content-Type: text/html;charset=utf-8");

仅有的幸福

Open the file with a text editor, then save it as UTF-8, save it, overwrite the previous file, solve it, OK

世界只因有你

First of all. Must be uniformly coded. Different operating systems sometimes have different encodings. For example, I use Linux for work and sometimes the exported documents will be garbled on Win

伊谢尔伦

Try to look at the encoding of the browser. Just make sure that the encoding of files, pages, and browsers are all consistent.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!