Home >Web Front-end >JS Tutorial >ExtJS Chinese garbled GBK format encoding solution and code_extjs

ExtJS Chinese garbled GBK format encoding solution and code_extjs

WBOY
WBOYOriginal
2016-05-16 17:43:111092browse

In the past few days, I have been reading some Ext knowledge in the background. When I entered the work project, garbled characters appeared, so I summarized this article about the GBK format encoding solution for ExtJS Chinese garbled characters as a record.

1. Specific situation :

Introduction:

Copy code The code is as follows:

Ext- Learning|Test Project
02.
03.
04.
05.

After that, I wrote a simple example:
Copy code The code is as follows:



The result appears:

2. The encoding of the page is GBK, the specific code is as follows :

3. Solution :

(1) Defining the page encoding as UFT-8 works fine, but the project specified encoding is UTF-8, so this idea cannot be used.

(2) Change the imported resource file (/js/ext/ext-lang-zh_CN.js) to the appropriate encoding, as follows:

A. Open this js file with EditPlus and choose Save As, as shown below:

B. You can see that there are 5 encoding options in total, but none of them are what we need. We click on the more small button at the back (the inconspicuous button with two dots on it)

After seeing the picture below, select the code in the picture and confirm:

Then, replace the js in the project and test again:

As you can see, the garbled code problem has been solved and the text is displayed normally.

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