portals-portalapps-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woonsan Ko <woon_...@yahoo.com>
Subject Re: I find where a problem with NLS in html-docs in Web Content portlet.1.0
Date Mon, 30 Nov 2009 12:11:31 GMT
Hi Vladimir,



----- Original Message ----
> From: Vladimir Figurov <VFigurov@asia-soft.kz>
> To: portalapps-dev@portals.apache.org
> Sent: Fri, November 27, 2009 2:17:17 PM
> Subject: I find where a problem with NLS in html-docs in Web Content portlet.1.0
> 
> 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  
> tag - then read a Server encoding parameter.

I see what the problem was now.
I agree to your idea to read the charset from the meta tag first, response encoding later.
I will help to fix this soon.

Kind regards,

Woonsan

> 
> 
> 
> 
> -- Vladimir



      

Mime
View raw message