Eclipse modify encoding format and font size

The default encoding format of the Windows platform is GBK, which means that the project code created in this workspace is GBK, and the java file created in the project is also GBK.
When this project is opened under linux (if there is Chinese in the project file, for example, Chinese comments), garbled characters will appear.
Therefore, when using Eclipse for Java development under the Windows platform, the encoding format should be modified first. Generally, there are 3 parts that need to be modified

1. Modify the default encoding of the workspace and import a project project in Eclipse. If the encoding of the project file is inconsistent with your Eclipse encoding, it will cause garbled characters. At this time, you need to modify the default encoding:
Window-->Preferences --> General- ->Workspace:Text file encoding, select Other, change to UTF-8.

2. Modify the encoding of a certain file type, sometimes we need to specify the encoding format for a certain type of file (such as: *.jsp, *.java, etc.):
window-->preferences-->General-->Content Types

Select Java Class File, fill in utf-8 in the default encoding below, click Update

The same is true for Text.

3. Modify the encoding of the file
Sometimes we import the project file, but it is not imported into our workspace, it is just a reference. At this time, if there is a problem with encoding, we can modify the encoding of the file to view.
Right-click on the Eclipse project file and select Properties, in Resource, choose to modify the encoding format.

 

By default, the encoding in the template file (that is, the top line) used by Eclipse to create new JSP files is ISO-8859-1

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

Modification method: windows-->preference-->Web-->JSP Files-->Find the encoding on the right and modify it to the encoding you want

 

How to set the font size in eclipse

http://jingyan.baidu.com/article/f96699bb9442f3894e3c1b15.html

Guess you like

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