Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the eclipse coding method?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what is the eclipse coding method". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, set the default encoding format for new common files, that is, the format in which the files are saved.

When MyEclipse is not set, the encoding of the file is saved by default, which is generally the same as that of simplified Chinese operating systems (such as windows2000,windowsXP), that is, GBK.

In simplified Chinese system, ANSI code represents GBK code; in Japanese operating system, ANSI code represents JIS code.

Window-- > Preferences-- > General-- > content Types

Expand each subitem in the right window and enter the encoding format in turn, such as "UTF-8" and click "update" to set it.

For example: in the above settings, set the jsp default encoding format to "UTF-8", then the new jsp files will be saved in the "UTF-8" format.

Also set the java default encoding format to "UTF-8", then the new java files will be saved in the "UTF-8" format.

Set the html default encoding format to "UTF-8", then the new html files will be saved in the "UTF-8" format.

The above set the file save encoding format, the default opening method (decoding) will be the same as saving the encoding format.

Second, set the default encoding format for other newly built files, that is, the file saving format.

In the first setting, you only set the encoding format for common file types. If you create a new file with no suffix, that is, no named file type, MyEclipse cannot determine which encoding to use

Format save, use the default file save encoding format GBK to save. This default saves the encoding format, which can be modified in the following ways:

Window-- > preferences-- > general-- > workspace on the right side of Text file encoding-> Other Select UTF-8

Third, a single file to view the encoding format (that is, the encoding format used to open the file) changes. This method does not change the encoding format of the file, but simply tells MyEclipse which encoding format to use for decoding.

Right-click on the file you want to view, such as Test.java-> Properties-- > Resource on the right Text file encoding-> Other, and you can modify it.

For example, if you set the encoding format of * .java file to "UTF-8" in "one", then if you open the file with the suffix java, it will be decoded in "UTF-8" format by default. If someone gives you one,

Write a good java file, but it is saved in GBK code, so when you open it now, it will show garbled code. Right-click on this file-- > Properties-- > Resource on the right side of Text file

Encoding-> Other-> GBK, you can display the contents normally.

Fourth, specify the MyEclipse document when the page content data encoding format, such as html, or the jsp page before submitting the form, the user input information encoding format, configuration file xml parameter encoding format and so on.

It mainly notifies the browser or server of the encoding format of the transmitted data.

Window-- > Preferences-- > MyEclipse-- > Files and Editors-- > Select subitems-- > Encoding

For example: select UTF-8

When you create a new jsp file, the contentType= "text/html; charset=UTF-8" pageEncoding= "UTF-8" is automatically generated without having to change it manually every time.

When you create a new html file, http-equiv= "Content-Type" content= "text/html; charset=UTF-8"

When you create a new xml file

This is the end of the content of "what is the eclipse coding method?" Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report