tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jean-frederic clere <jfrederic.cl...@fujitsu-siemens.com>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Date Thu, 05 May 2005 07:00:56 GMT
Remy Maucherat wrote:
> jfclere@apache.org wrote:
> 
>> jfclere     2005/05/04 00:04:30
>>
>>   Modified:    catalina/src/share/org/apache/catalina/servlets
>>                         DefaultServlet.java
>>   Log:
>>   When the file comes from a resource fileEncoding was not working.
>>   The default beahviour is unchanged: the file is send without a 
>> conversion.
> 
> 
>>            if (cacheEntry.resource != null) {
>>                byte buffer[] = cacheEntry.resource.getContent();
>>                if (buffer != null) {
>>   +                if (fileEncoding != null &&
>>   +                    cacheEntry.attributes.getMimeType()!=null &&
>>   +                    
>> cacheEntry.attributes.getMimeType().equals("text/html")) {
>>   +                    /* the "binary" have to be converted from 
>> fileEncoding to UTF-8 */
>>   +                    try {
>>   +                        String str = new String(buffer, fileEncoding);
>>   +                        buffer = str.getBytes("UTF-8");
>>   +                    } catch (Exception e) {
>>   +                    }
>>   +                }
>>                    ostream.write(buffer, 0, buffer.length);
>>                    return;
> 
> 
> So, can you revert the patch ? I think that's what we more or less 
> agreed on, right ?

Done.

> 
> Forcing the use of a writer using a getWriter call would likely be more 
> efficient (much less GC hungry at least).
> 
> Rémy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message