Hi
I find where a problem with NLS in html-docs in Web Content portlet.1.0 - the InputStreamReader's encoding take the value from ( for some reasone ) is incorrected httpMethod.getResponseCharSet(). Look at this:


org.apache.portals.applications.webcontent.portlet.WebContentPortlet {

 // Create the httpMethod object
 doWebContent(...,RenderRequest request,..) {
    ...
    HttpClient httpClient = getHttpClient(request);
httpMethod = getHttpMethod(httpClient, getURLSource(sourceAttr, sourceParams, request, response), sourceParams, method, request);
    ...
 }


 // Use a httpMethod object for getting response.
 doHttpWebContent(..., HttpMethod httpMethod,...) {
   ...
   String encoding = ((HttpMethodBase)httpMethod).getResponseCharSet();
   if (encoding == null)
// Vladimir Figurov comment - NOT ONCE NO RUN HERE - encoding is ISO-8859-1
               encoding = getContentCharSet(bis);
   Reader htmlReader = new InputStreamReader(bis, encoding);
   ...
 }
}


As I see, the Author is try read the first the source's HttpServer encoding, and only if is NULL, try getted encode value from html-doc's head... But I think, that the must read from html-doc's in first - since the on ONE HttServer instance may be a perfectly hosted a different html-docs with different encoding... and only if html.doc's not including a <meta .. encoding> tag - then read a Server encoding parameter.




--
Vladimir

Reply via email to