MyEclipse encoding format modification

1. Set the default encoding format of newly created common files.  
    When MyEclipse is not set, the encoding of the file to be saved by default is generally the same as the encoding of the Simplified Chinese operating system (such as windows2000, windowsXP), that is, GBK.  
    Under the Simplified Chinese system, ANSI encoding represents GBK encoding; under Japanese operating system, ANSI encoding represents JIS encoding.  
    Window-->Preferences-->General -->content Types Expand each sub-item in the right window, enter the encoding format in turn, such as "UTF-8" and click "update" to set it.  
    For example: In the above settings, set the default encoding format of jsp to "UTF-8", then the newly created jsp files will be saved in "UTF-8" format. Also set the java default encoding format to "UTF-8", then the newly created java files will be saved in "UTF-8" format. Set the html default encoding format to "UTF-8", then the newly created html files will be saved in "UTF-8" format.  
    The above sets the save encoding format of the file, and the default opening method (decoding method) will be the same as the save encoding format.   
2. Set the default encoding format of new files.  
    In the first setting, only the encoding format of common file types is set. If you create a new file without a suffix name, that is, without specifying the file type, MyEclipse cannot determine which encoding  
    format to use to save, so it will use the default file save encoding format GBK to save. This default save encoding format can be modified as follows:  
    window-->preferences-->general-->workspace On the right side Text file encoding ->Other select UTF-8 
3. Change the encoding format for viewing a single file (that is, the encoding format used to open the file).  
    This method does not change the encoding format of the file, it just tells MyEclipse which encoding format to use for decoding.  
    On the file to be viewed, for example, right-click on the file Test.java --> Properties-->Resource on the right side Text file encoding ->Other, you can modify it.  
    For example, if you set the encoding format of the *.java file in "One" to "UTF-8", then when you open a file with the suffix java, it will be decoded in "UTF-8" format by default.  
    If someone gave you a written java file, but he saved it with GBK encoding, then when you open it now, it will display garbled characters. Right-click on this file-->Properties-->Resource on the right side Text file encoding ->Other ->GBK, you can display the content normally.  
Fourth, specify the page content data encoding format when MyEclipse writes the file, such as html, Or before submitting the form in the jsp webpage, the encoding format of the information input by the user, the parameter encoding format in the configuration file xml, etc.  
    It mainly informs the browser or server of the encoding format of the transmitted data.  
    window-->Preferences-->MyEclipse-->Files and Editors-->Select sub-items-->Encoding   
    For example: select UTF-8,  
    When creating a new jsp file, contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" will be automatically generated, so there is no need to manually change it every time.  
    When creating a new html file, http-equiv="Content-Type" content="text/html; charset=UTF-8"   
    When creating a new xml file, <?xml version="1.0" encoding="UTF-8"? >

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326535819&siteId=291194637