RE: Simplified Chinese to UTF-8 (SOLVED)
Sorry Dan, I used the Filter as is (using UTF-8) and removed the code to try to convert it again and it works beautiflly for both Chinese and any type of Japanese I can throw at it. Thanks again. -- Nathan Christiansen Tahitian Noni International http://www.tahitiannoni.com -Original Message- From: Nathan Christiansen Sent: Friday, August 15, 2003 12:25 PM To: [EMAIL PROTECTED] Subject: RE: Simplified Chinese to UTF-8 Thanks Dan. I did download the filter code and tried all of the Simplified Chinese encodings without luck. I am unsure which encoding that the IME is sending (since I do not read Chinese myself and can't read the help manual). Looking through the filter code, it would be exactly similar if I added the request.setCharacterEncoding() call to the top of the JSP page since I am calling the JSP page directly. Any other suggestions? -- Nathan Christiansen Tahitian Noni International http://www.tahitiannoni.com -Original Message- From: Dan Tran [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 10:54 AM To: Nathan Christiansen Subject: Re: Simplified Chinese to UTF-8 You need to implement a filter according the folowing link http://www.anassina.com/struts/i18n/i18n.html -Dan - Original Message - From: "Nathan Christiansen" <[EMAIL PROTECTED]> Newsgroups: Tomcat Sent: Friday, August 15, 2003 9:33 AM Subject: Simplified Chinese to UTF-8 > I have an annoying problem that I am trying to figure out. > > I need to support Simplified Chinese in a webapp that also supports ISO-8859-1. > > I figure the best way is to make my web pages encoded in UTF-8. > > The database access and display works, but I am having trouble with getting post data to come out correctly. > > I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01. > > I have tried using the following JSP file to test the post input from a Windows 2000 Server box that allows me to input Simplified Chinese. But every encoding in the JSP file gives me garbage back. > > Any ideas? > > Thanks. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Simplified Chinese to UTF-8
Thanks Dan. I did download the filter code and tried all of the Simplified Chinese encodings without luck. I am unsure which encoding that the IME is sending (since I do not read Chinese myself and can't read the help manual). Looking through the filter code, it would be exactly similar if I added the request.setCharacterEncoding() call to the top of the JSP page since I am calling the JSP page directly. Any other suggestions? -- Nathan Christiansen Tahitian Noni International http://www.tahitiannoni.com -Original Message- From: Dan Tran [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 10:54 AM To: Nathan Christiansen Subject: Re: Simplified Chinese to UTF-8 You need to implement a filter according the folowing link http://www.anassina.com/struts/i18n/i18n.html -Dan - Original Message - From: "Nathan Christiansen" <[EMAIL PROTECTED]> Newsgroups: Tomcat Sent: Friday, August 15, 2003 9:33 AM Subject: Simplified Chinese to UTF-8 > I have an annoying problem that I am trying to figure out. > > I need to support Simplified Chinese in a webapp that also supports ISO-8859-1. > > I figure the best way is to make my web pages encoded in UTF-8. > > The database access and display works, but I am having trouble with getting post data to come out correctly. > > I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01. > > I have tried using the following JSP file to test the post input from a Windows 2000 Server box that allows me to input Simplified Chinese. But every encoding in the JSP file gives me garbage back. > > Any ideas? > > Thanks. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Simplified Chinese to UTF-8
I have an annoying problem that I am trying to figure out. I need to support Simplified Chinese in a webapp that also supports ISO-8859-1. I figure the best way is to make my web pages encoded in UTF-8. The database access and display works, but I am having trouble with getting post data to come out correctly. I am running Tomcat 4.1.24 on a RedHat Linux 7.1 box with JDK 1.4.1_01. I have tried using the following JSP file to test the post input from a Windows 2000 Server box that allows me to input Simplified Chinese. But every encoding in the JSP file gives me garbage back. Any ideas? Thanks. -- Nathan Christiansen Tahitian Noni International http://www.tahitiannoni.com < Included JSP File > <[EMAIL PROTECTED] contentType="text/html; charset=UTF-8" %><[EMAIL PROTECTED] import="java.io.*" %><% String strRawData = request.getParameter("data"); String strGBK = null; String strEUC_CN = null; String strGB18030 = null; String strMS936 = null; String strCp935 = null; String strGB2312 = null; String strMS950 = null; String strBig5 = null; String strBig5_HKSCS = null; String strCp937 = null; String strCp950 = null; String strCp964 = null; String strEUC_TW = null; if (strRawData != null) { strGBK = new String(strRawData.getBytes("GBK")); strEUC_CN = new String(strRawData.getBytes("EUC_CN")); strGB18030 = new String(strRawData.getBytes("GB18030")); strMS936 = new String(strRawData.getBytes("MS936")); strCp935 = new String(strRawData.getBytes("Cp935")); strGB2312 = new String(strRawData.getBytes("GB2312")); strMS950 = new String(strRawData.getBytes("MS950")); strBig5 = new String(strRawData.getBytes("Big5")); strBig5_HKSCS = new String(strRawData.getBytes("Big5_HKSCS")); strCp937 = new String(strRawData.getBytes("Cp937")); strCp950 = new String(strRawData.getBytes("Cp950")); strCp964 = new String(strRawData.getBytes("Cp964")); strEUC_TW = new String(strRawData.getBytes("EUC_TW")); } %> Charset Test Page <% if (strRawData != null) { %> strRawData = <%= new String(strRawData.getBytes("UTF8")) %> strGBK = <%= new String(strGBK.getBytes("UTF8")) %> strEUC_CN = <%= new String(strEUC_CN.getBytes("UTF8")) %> strGB18030 = <%= new String(strGB18030.getBytes("UTF8")) %> strMS936 = <%= new String(strMS936.getBytes("UTF8")) %> strCp935 = <%= new String(strCp935.getBytes("UTF8")) %> strGB2312 = <%= new String(strCp935.getBytes("UTF8")) %> strMS950 = <%= new String(strMS950.getBytes("UTF8")) %> strBig5 = <%= new String(strBig5.getBytes("UTF8")) %> strBig5_HKSCS = <%= new String(strBig5_HKSCS.getBytes("UTF8")) %> strCp937 = <%= new String(strCp937.getBytes("UTF8")) %> strCp950 = <%= new String(strCp950.getBytes("UTF8")) %> strCp964 = <%= new String(strCp964.getBytes("UTF8")) %> strEUC_TW = <%= new String(strEUC_TW.getBytes("UTF8")) %> <% } %> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]