tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Date Thu, 01 Feb 2001 04:29:58 GMT
remm        01/01/31 20:29:58

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Fix more i18n issues in the directory browser : output as Unicode. That
    should fix the names of the files which are displayed.
  
  Revision  Changes    Path
  1.25      +13 -6     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DefaultServlet.java	2001/01/31 23:05:08	1.24
  +++ DefaultServlet.java	2001/02/01 04:29:57	1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.24 2001/01/31 23:05:08 remm Exp $
  - * $Revision: 1.24 $
  - * $Date: 2001/01/31 23:05:08 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.25 2001/02/01 04:29:57 remm Exp $
  + * $Revision: 1.25 $
  + * $Date: 2001/02/01 04:29:57 $
    *
    * ====================================================================
    *
  @@ -122,7 +122,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.24 $ $Date: 2001/01/31 23:05:08 $
  + * @version $Revision: 1.25 $ $Date: 2001/02/01 04:29:57 $
    */
   
   public class DefaultServlet
  @@ -1532,7 +1532,7 @@
                                      resourceInfo.path);
                   return;
               }
  -            contentType = "text/html";
  +            contentType = "text/html;charset=UTF-8";
           }
   
   
  @@ -1837,7 +1837,14 @@
   
   	// Prepare a writer to a buffered area
   	ByteArrayOutputStream stream = new ByteArrayOutputStream();
  -	PrintWriter writer = new PrintWriter(stream);
  +        OutputStreamWriter osWriter = null;
  +        try {
  +            osWriter = new OutputStreamWriter(stream, "UTF8");
  +        } catch (Exception e) {
  +            // Should never happen
  +            osWriter = new OutputStreamWriter(stream);
  +        }
  +        PrintWriter writer = new PrintWriter(osWriter);
   
   	// FIXME - Currently pays no attention to the user's Locale
   
  
  
  

Mime
View raw message