UTF-8 settings in myeclipse
if you want to enable plug-in development applications to have better internationalization support, to maximize the support of Chinese output, it is best to make Java files using UTF-8 encoding. However, the default character encoding for the Eclipse workspace (workspace) is the operating system default encoding, Simplified Chinese operating system (Windows XP, Windows Simplified Chinese) The default encoding is GB18030, the engineering code established in this workspace is GB18030, and the Java file created in the project is also GB18030. If you want to make the new project, Java files directly to UTF-8, you need to do the following:
1. Windows->preferences ... Open the Preferences dialog box, left navigation tree, navigate to General->workspace, right side text file encoding, select other, change to UTF-8 , the text file encoding in the Properties dialog box for the new project is UTF-8.
2. Windows->preferences ...Open the Preferences dialog box, left navigation tree, navigate to General->content Types, right context Types tree, click Text, select Java Source File , enter UTF-8 in the default encoding input box below, and Click Updateto set the Java file encoding to UTF-8. Other Java application development related files such as: Properties, XML, etc. have been specified by the Eclipse default, respectively, Iso8859-1, UTF-8, If you need to change the encoding format in development, you can specify it here.
3. After these two steps, create a new JavaThe file is UTF-8Encoding, EclipseCompile, run, Debug no problem, but do RCPApp's Product output, or plug-in when output, it is always an error, or it cannot be compiled ( application, or plug-in Plugin add one line, javacdefaultencoding ... = Utf-8 encode. This setting needs to be guaranteed for all Java encoding format, if not all, you can refer to the eclipse< Span style= "font-family: the song Body;" > Help (Plug-in development environment Guide > Reference > Feature and Plug-in Build configuration) encoding.
if plug-in development, RCP application development originally based on other coding, such as GB18030, want to convert to UTF-8, then first, do the above work, and then by looking for encoding conversion tools, such as Iconv-based batch Conversion tool, Convert the original code to UTF-8 encoding, note that only the Java source files are converted, other types of files may already be more appropriate encoding, the original project properties of the Text file encoding, from the original code to UTF-8 .
Reprint: http://www.blogjava.net/donghang73/archive/2010/07/20/326677.html