Home  >  Q&A  >  body text

php - 网页中文乱码无法解决,见图

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

伊谢尔伦伊谢尔伦2686 days ago719

reply all(9)I'll reply

  • 迷茫

    迷茫2017-05-16 13:12:16

    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

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:12:16

    Check whether the relevant folder names are in Chinese

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:12:16

    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

    reply
    0
  • 某草草

    某草草2017-05-16 13:12:16

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

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:12:16

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:12:16

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

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:12:16

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

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:12:16

    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

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:12:16

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

    reply
    0
  • Cancelreply