search

Home  >  Q&A  >  body text

php - The Chinese garbled code on the webpage cannot be solved, see the picture

< /p>

I have done it on another computer and the display is normal. When I transfer it to my own computer, it looks like this
The file encoding is utf-8, and the page has also been set to <meta charset="utf-8">. The database encoding is also utf8. What is the problem?

伊谢尔伦伊谢尔伦2754 days ago770

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