Eclipse Encoding Format settings

Source: Internet
Author: User

Reference: http://www.cr173.com/html/26783_1.html

1. Coding format for programming tools

The default encoding for new items in Eclipse is GBK, which modifies the default encoding format, which is only valid for the current workspace

Select the text tree, click Open, select Java Source file, enter UTF-8 in the default encoding input box below, press the Update button, then set the Java file encoding to UTF-8

(Note: Java application Development related files such as: properties, XML, etc. have been specified by the Eclipse default, respectively, Iso8859-1,utf-8, such as the development of the need to change the encoding format can also be specified here.) )

Of course I usually directly select text to set.

2. Encoding format in the project

Set the encoding format in the project, in Web. xml

<!--character encoding filters--
<filter>
<filter-name>code</filter-name>
<filter-class>com.bear.filter.CodeFilter</filter-class>
<init-param>
<param-name>encode</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>code</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Encoding format in 3.tomcat

Modify the Server.xml file

<connector uriencoding= "UTF-8" connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443"/ >

Eclipse Encoding Format settings

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.