tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Date Wed, 04 May 2005 17:30:11 GMT
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 ?

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


Mime
View raw message