Due to operating systems, browsers, databases, the character sets in JVM are different. Applications based on WebLogic Server developed Chinese display garbled issues, in fact, Web applications running on WebLogic Server have a lot of settings related to character sets, below To make a summary, in order to properly handle Chinese, it is best to set these settings.
1. Add <% @ page contentType = "text / html; charset = GBK"%> Specify the character set adopted by the JSP.
2. Add:
3. Add
4. WebLogic Server needs to convert the data in HTTP Request (Get and POST) from its original encoding to Unicode so that the Java Servlet API is processed. For this conversion, WebLogic Server needs to know the encoding mode of the data in the HPPT Request. This can be set in WebLogic.xml
5. From the Chinese display from the Oracle database, in this case, if the database uses the Chinese character set, and use Type 2 JDBC Driver, you can add WebLogic.codeset = GBK properties to solve this problem. The code is as follows: java.util.properties PROPS = new java.util.properties (); Props.Put ("WebLogic.codeEt", "GBK"); Props.Put ("User", "Scott"); Props.put ("Password", "Tiger"); String ConnectURL = "JDBC: WebLogic: Oracle"; Driver MyDriver = (DRIVER) Class.Forname ("WebLogic.jdbc.oci.driver). NewInstance (); connection conn = myDriver .connect (connectURL, PrOPS); 6. If you use the WTC call Tuxedo, you cannot display Chinese in the JSP page, you must make the NLS_LANG environment variable on the server installed with Tuxedo, the same settings as the set of character sets in the database. If the character set in the background Oracle database is set to Simplified Chinese_China.zhs16GBK, then the NLS_LANG environment variable on the Tuxedo application server should be set to: export nls_lang = "simplified Chinese_china.zhs16GBK"