Java coding Solution

Source: Internet
Author: User

Fix garbled characters

I. Several Common Character Set encodings:

NASCII code: Chinese characters not supported

NISO-8859-1: Chinese characters not supported

Gb2312 and GBK: Chinese characters are supported.

NUnicode: supports Chinese Characters

NUTF-8: supports Chinese

Ii. Principles: Five unification:

1. browser Encoding

2. Right-click the jsp file code and choose Properties, text file code, or jsp file under construction)

3. Eeclipse: The two encodings defined in the file can be clicked before creating the file -- preferences ---- web ----- jspfiles ---- set encoding)

4. myeclipse: set encoding: click "window", the second to the last line) -- "" Preferences last item) "---" myeclipse --> filesandeditors ---> click jsp (do not open) -- UTF-8 encoding

5. Database Encoding

NOTE: If garbled characters still exist, the solution is as follows:

(1) Add request. setCharacterEncoding ("UTF-8") to the file ");

(2) whether the method attribute in the <from> </from> label is post

Post: The uploaded content is high and secure, but the transmission speed is slow.

Get: The data is transmitted with less content, unsafe content, but fast transmission speed.

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.