* submitted garbled
* GET: (parameter in the address bar to submit, the address bar also has its own code, the default is the foreigner's iso-8859-1)
* * Modify the Tomcat default character set. (The scope of the impact is too large, it may affect other items, not recommended)
* * Urlencoder and Urldecoder class (on the line 2 back)
* * New String (s.getbytes ("iso-8859-1"), "UTF-8");
* * POST:
* * The buffer of the request object is iso-8859-1 by default.
* * request.setcharacterencoding ("UTF-8"); (sets the decoding mode of the buffer)
* * Output to page Chinese:
* * Getoutputstream ();
* * Response.getoutputstream (). Write ("Meimei". GetBytes ());
* * Not necessarily:
* * GetBytes (); default encoding GBK.
* GetBytes ("UTF-8");
* * Open with GBK when the browser is open.
* Response.setheader ("Content-type", "text/html;charset=utf-8");
* * Getwriter (); ---character stream buffer
* * Response.getwriter (). println ("Meimei");
* * will certainly.
* * Response buffers are iso-8859-1 by default.
* 1. Set the encoding of the response buffer
* Response.setcharacterencoding ("UTF-8");
* * 2. How to encode the browser's opening
* Response.setheader ("Content-type", "text/html;charset=utf-8");
* * * * * * RESPONSE.SETCONTENTTYPE ("Text/html;charset=utf-8");
Java--Commit garbled summary