1. Output Chinese in the web page.
Java used in network transmission is "ISO-8859-1", so transformation is required when output, such as:
String str = "Chinese";
Str = new string (Str.getbytes ("GB2312"), "8859_1");
However, if you use the code when the program is compiled, the encoding is "GB2312", and this program is run on the Chinese platform, and this problem will not be noted.
2. Read Chinese from the parameters This is just in contrast as: str = new string (Str.getbytes), "GB2312");
3. A simpler method in the operation DB is: In "Control Face Random", set the "region" to "English (US)". If there is a garbled, you can set the following: Take Chinese: str = new string (Str.getBytes)); Enter Chinese to DB: Str = New String (Str.getbytes ("ISO-8859 -1"));
4, Chinese solution in JSP: In "Control Field", set the "Region" to "English (US)". Join in the JSP page: If it is not normal, you will also make the following conversion: Such as: name = new string (Name.getbytes ("ISO-8859-1"), "GBK"); there will be no Chinese problem.