Several Methods for JSP or Java garbled characters in netbeans (downmoon collection)

Source: Internet
Author: User
Tags netbeans

In fact, netbeans and eclipse are similar to garbled characters, just as the. NET environment occasionally produces small errors.

Key points: Because Java must implement cross-platform implementation (not a small tone, but a great reputation), the encoding will be more messy .) Therefore. Java ide tools such as netbeans and eclipse equations both have two encoding formats: source code format and compilation format.

If the open or add source code is messyCodeEncoding settings are incorrect. If garbled characters are generated during compilation, compilation settings are generally related to specific projects. Okay.

Try these methods:

I,In Nb, tools-> Option-> advance-> Editor-> JAVA source-> encoding: UTF-8
Enter-encoding UTF-8 in your project properties in the run and compile project
NB code entry interface is the default use of the system code page, into the UTF-8, no matter which platform is transplanted don't worry about it.
(This option is not available in netbeans ide 6.5. You are invited to pay monthly attention to this option)

II,If you are using a Chinese version, perform the following operations: tool> Option> font and color> Configuration File> Earth> OK
If you are using an English version or run the "D:" 2000 "Java" netbeans65 "bin" netbeans.exe "-- locale en: US command to start netbeans
Perform the following operations: Tools-> options-> fonts & Color-> profile-> Earth-> OK
(This method is not well-studied. Please pay attention to the invitation monthly)

III,Sun mentioned that the default encoding type for netbeans is UTF-8. The default encoding of caffe is gb18030.
If you are importing a project from eclipse, open netbeans and change the default encoding UTF-8 to gb18030 in the project properties. ^ _ ^. Chinese characters are returned. The project imported to mingwstudio and eclipse has no Chinese garbled characters.

By the way, you can modify the eclipse encoding.
Windows> preferences> General> content types
Click "text" in the window on the right and select JSP (Java)> default encoding to modify the encoding of the JSP file .. Files in other formats, and so on.

Note: After you reset the encoding in eclipse, you need to update the code once.

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.