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.