The MyEclipse default encoding for GBK, modified UTF8 method

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The default MyEclipse code was GBK, the JS file is ISO-. The default encoding...

How can this be the case?

All modified UTF8 method:

1,windows->Preferences... Open the "preferences" dialog box, the left navigation tree, navigate to the general-> Workspace Text file encoding, right, select Other, change to UTF-8, after the new building engineering the properties dialog box in Text file encoding UTF-8.

2, windows->Preferences... Open the "preferences" dialog box, the left navigation tree, navigate to the general-> Content Types, right Context Types tree, open the Text, select Java Source File, input UTF-8, Default encoding input in the box below Update, set the Java file encoding for UTF-8. Other Java application development related documents such as: properties, XML are specified by the MyEclipse default, respectively ISO8859-1, UTF-8, such as the development of really needs to change the encoding format can be in the designated.

3,After the above two steps, create a new Java file is the UTF-8 code, MyEclipse compiler, running, debugging is no problem, but do RCP applications of the Product output, or plug-in output, is always wrong, or fails to compile (output to compile), plug-in either lost the Chinese garbled. At this time need to RCP application, add a row or plug-in Plugin project in build.properties, javacDefaultEncoding.. = UTF-8. Let the output when compiling UTF-8 code know java source file. To ensure that all Java source files in UTF-8 format this setting, if not entirely, you can refer to the MyEclipse help (Plug-in Development Environment Guide in > Reference > Feature and Plug-in Build configuration), recommended that all Java source files is UTF-8 code.

If the plug-in development, RCP application development that based on other code, such as GB18030, would like to convert to UTF-8, first, work above; and then find the code conversion tools, such as iconv based batch conversion tool, the original code into UTF-8 code, only note conversion java source file, other types of files may have been more appropriate code; the original engineering properties in the Text file encoding, from the original code can be changed to UTF-8.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Frederic at November 14, 2013 - 3:42 PM