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.