Why do I need to transcode?
Four scenarios where the client sends a request to the server: 1, direct access to the URL method; 2, the page link (belongs to get request); 3. Form get Submit ; 4. Form Post Submission
1.url (URL and page link): Each big browser, each operating system of the URL Uri, querystring encoding may be different . Tomcat decoding of URIs is the first to get the connector of the decoder set,
the configuration is in Server.xml , <connector uriencoding="Utf-8"/> is parsed with the default encoding iso-8859-1 if not defined.
2, form: Send the request is based on the set of CharSet encoding, decoding, get mode according to the settings of uriencoding, post mode is still based on the charset of the page setup.
@ Reference article
Jetty default is Utf-8. Jetty and Unlike Tomcat, which is not modified in the XML configuration file, it can be added to the JVM parameters: Dorg.mortbay.util.URI.charset= character encoding @ Reference article
How do I transcode?
Iso-8859-1 Turn Utf-8
String Args=new string (Request.getparameter ("args". GetBytes ("Iso8859-1"), "Utf-8");
Javaweb background transcoding