Original: http://lvxin3792002.blog.163.com/blog/static/128939280201081324839/
Today finally realized the use of the form provided by EXT, function, the contents of the database through the JSON display in the page, and then the page after the modified content of the Frompanel to use the Submit function to update to the database. But after the success, but found a very uncomfortable problem: the FTL file page display Chinese garbled.
MyEclipse is using the default GBK encoding: Can be viewed here: Window->preferences->workspace->text file encoding
STRUTS2 is configured so encoded in the configuration file: <constant name= "struts.i18n.encoding" value= "GBK"/>
Browser encoding mode Select GBK, the main page of the display of Chinese is correct, but the loading of the FTL page display Chinese is still garbled. This is because the default encoding format for the FTL file is GBK in background editing, but the encoding format it outputs becomes utf-8. In this way, Chinese will show garbled characters.
We can select an FTL file, right-click->properties->text file Encoding->other Select UTF-8, you will see this page in the MyEclipse display and the Web page to see the same garbled. We can change the format of the FTL file, the entire copy of the page into the TXT document, and then change the encoding format, and then copy the contents of the TXT file into the original file.
Browser inside refresh, Chinese will not show garbled.
The problem of *.FTL file garbled in Chinese