Home  >  Article  >  Web Front-end  >  How to deal with jquery load Chinese garbled characters

How to deal with jquery load Chinese garbled characters

coldplay.xixi
coldplay.xixiOriginal
2020-12-24 11:01:232378browse

The solution to jquery load Chinese garbled characters: first use editplus to create the [demo.txt] text; then save the text file [demo.txt] as [utf-8] format, and the Chinese will be displayed correctly.

How to deal with jquery load Chinese garbled characters

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, DELL G3 computer.

Solution to jquery load Chinese garbled characters:

Recommendation: jquery video tutorial

Use editplus to create demo.txt (saved by ANSI),

$("#div1").load("demo.txt");

//div displays Chinese garbled characters

defined in html59d54027d814bba7a6c118810bbc6025d,Inconsistency in encoding and decoding causes garbled Chinese characters.

Save the text file demo.txt as utf-8 format. The Chinese text is displayed correctly. The problem is solved.

Related free Learning recommendation: js video tutorial

The above is the detailed content of How to deal with jquery load Chinese garbled characters. For more information, please follow other related articles on the PHP Chinese website!

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