Garbled text has always been a headache for many programmers. Many articles on Garbled text have been introduced in this article and do not need to be cumbersome.
The basic concepts are as follows:
Http://www.tingko.net/School/java/20139.html
Http://www.tingko.net/School/java/20140.html
The description is clear and provides a solution, which is helpful for the system to master the coding problem.
This article focuses on Windows:
In Tomcat + Struts + JSP mode, the URL is garbled in Japanese.
The solution adds uriencoding to server. xml.
<Connector
Port = "8080" maxthreads = "150" minsparethreads = "25" maxsparethreads = "75"
Enablelookups = "false" redirectport = "8443" acceptcount = "100"
DEBUG = "0" connectiontimeout = "20000"
Disableuploadtimeout = "true"Uriencoding = "Windows-31J"
/>
However, if this change is effective in Linux, experiments are required.
How to configure and solve the Garbled text in WebSphere is further discussed. This article is first put here for reference.
// ===================================2007/02/13 append ======================== =
What should I do with WebSphere?
The server uses ISO-8859-1 encoding to process URLs,
This will naturally cause problems. The solution is to use the startup parameters of the server JVM,
Add-duser. Language = ZH-duser. region = cn-dfile. Encoding = UTF-8-dclient. Override. Encoding = UTF-8 to set.
This does not seem to be a good solution because it is too dependent on the server configuration and is deployed on different servers,
Inconsistent results may occur. Therefore, this problem should be avoided as much as possible.
Some people say:
You only need to use the urlencode () function of JavaScript on the page to encode the URL first.
I tried, in the Tomcat environment, using only string ustr1 = urlencoder. encode (STR, "Windows-31J") does not work.