Resin Chinese garbled

zhaozj2021-02-11  189

The original published here (http://www.jdon.com/jive/thread.jsp?forum=62&thread=8977), but it seems that there is no one. :)

Recently used Struts1.1 Release Resin 2.1.8 JDK1.4.1 on Linux, there is no special handling (like many articles in JSP page plus <% @ Page ContentType = "text / html; charset = GBK "%>, Or revice.setCharateEnderEnderEndenCoding, etc. The WAR package was thrown into Solaris, and the result appeared. Then I checked a lot of ways, but there was no way to be effective in Linux and Solaris. Later, I saw this article (http://www.jdon.com/Jive/thread.jsp?forum=62&thread=8398), see Jackyz's explanation, saying the RESIN default ISO-8859-1 encoding method, I think Another method is to use System.SetProperty ("File.Encoding", "ISO-8859-1"); set Java's operating environment. Since my program structure is similar to the Struts-Example program comes with Struts, there is also a plugin, so add this sentence in Plugin's init. After adding this, it runs normally on Linux and Solaris. JSP pages and servlets have not been modified. I use the following code to check the system's encoded import java.io. *; Import java.lang. *; Class showenv {public static void main (String [] args) {system.out.println (System.getProperty ("File. Encoding "));}} I use Linux output is ISO-8859-1 Solaris output is ISO646-US I also tried to put System.SetProperty (" File.Encoding "," ISO-8859-1 "); ISO-8859-1 is changed to other coding types, there will be garbled. Thank you Jackyz's article.

转载请注明原文地址:https://www.9cbs.com/read-5133.html

New Post(0)