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]>