You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by am...@apache.org on 2003/12/03 19:53:15 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardServer.java

amyroh      2003/12/03 10:53:15

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardServer.java
  Log:
  Fix bugzilla 25138 submitted by Takashi Okamoto <to...@kun.ne.jp>.
  
  Revision  Changes    Path
  1.23      +10 -7     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java
  
  Index: StandardServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardServer.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StandardServer.java	2 Sep 2003 21:22:04 -0000	1.22
  +++ StandardServer.java	3 Dec 2003 18:53:15 -0000	1.23
  @@ -863,7 +863,7 @@
               // Open an output writer for the new configuration file
               PrintWriter writer = null;
               try {
  -                writer = new PrintWriter(new FileWriter(config));
  +                writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(config), "UTF8"));
               } catch (IOException e) {
                   if (writer != null) {
                       try {
  @@ -874,7 +874,8 @@
                   }
                   throw (e);
               }
  -
  +            
  +            writer.println("<?xml version='1.0' encoding='utf-8'?>");
               writer.print("<Context");
               storeAttributes(writer, context);
               writer.println(">");
  @@ -1202,7 +1203,7 @@
               // Open an output writer for the new configuration file
               writer = null;
               try {
  -                writer = new PrintWriter(new FileWriter(config));
  +                writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(config), "UTF8"));
               } catch (IOException e) {
                   if (writer != null) {
                       try {
  @@ -1214,6 +1215,7 @@
                   throw (e);
               }
   
  +            writer.println("<?xml version='1.0' encoding='utf-8'?>");
               indent = 0;
   
           }
  @@ -1222,6 +1224,7 @@
           for (int i = 0; i < indent; i++) {
               writer.print(' ');
           }
  +        
           writer.print("<Context");
           storeAttributes(writer, context);
           writer.println(">");
  
  
  

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