Home >Web Front-end >JS Tutorial >ExtJS Chinese garbled GBK format encoding solution and code_extjs
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:
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.