DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14464>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14464 WebPagePortlet supports iso-8859-1 only ------- Additional Comments From [EMAIL PROTECTED] 2002-11-23 13:00 ------- This is a critical issue for _i18n_. Many CJK users cannot use WebPagePortlet. (I think that WebPagePortlet2 has the same issue.) I checked the following patch created by Mamoru. Jetspeed works fine by applying it. Japanese characters are displayed :-) Please integrate the patch to CVS. -------- Original Message -------- Subject: patch for WebPagePortlet.java Date: Fri, 15 Nov 2002 20:48:11 +0900 From: Mamoru WATANABE <[EMAIL PROTECTED]> Reply-To: Jetspeed Developers List <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> I created the patch to fix Bug#14464. It changes to use charset parameter in the Content-Type field which is sent from the Web server. But, when charset parameter isn't sent from the Web server, it uses iso-8859-1. If it seems that there is not a problem, please integrate this patch. Mamoru WATANABE Index: WebPagePortlet.java =================================================================== RCS file: /home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/WebPagePortlet.java,v retrieving revision 1.13 diff -u -r1.13 WebPagePortlet.java --- WebPagePortlet.java 24 Oct 2002 14:59:25 -0000 1.13 +++ WebPagePortlet.java 15 Nov 2002 11:19:05 -0000 @@ -74,6 +74,7 @@ import java.io.Reader; import java.net.URL; import java.net.URLConnection; +import java.util.StringTokenizer; /** * A class that loads a web page and filters it to have certain features @@ -169,15 +170,23 @@ } long pageExpiration = pageConn.getExpiration(); - String encoding = pageConn.getContentEncoding(); + String encoding = "iso-8859-1"; + String contentType = pageConn.getContentType(); String tempString = null; String noCache = "no-cache"; - if(encoding == null) - { - // Standard HTTP encoding - encoding = "iso-8859-1"; - } + if (contentType != null) { + StringTokenizer st = new StringTokenizer(contentType, "; ="); + while (st.hasMoreTokens()) { + if (st.nextToken().equalsIgnoreCase("charset")) { + try { + encoding = st.nextToken(); + break; + } catch (Exception e) {} + } + } + st = null; + } /* * Determing if content should be cached. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
