tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/users MemoryUserDatabase.java
Date Wed, 14 Aug 2002 19:36:17 GMT
amyroh      2002/08/14 12:36:17

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardServer.java
               catalina/src/share/org/apache/catalina/users
                        MemoryUserDatabase.java
  Log:
  Improve internationalization - store file with utf-8 encoding and add
  encoding='utf-8' at xml header.
  
  Patch submitted by Takashi Okamoto toraneko@kun.ne.jp.
  
  Revision  Changes    Path
  1.4       +8 -5      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardServer.java	9 Aug 2002 17:20:48 -0000	1.3
  +++ StandardServer.java	14 Aug 2002 19:36:17 -0000	1.4
  @@ -71,8 +71,10 @@
   import java.beans.PropertyDescriptor;
   import java.io.File;
   import java.io.FileWriter;
  +import java.io.FileOutputStream;
   import java.io.InputStream;
   import java.io.IOException;
  +import java.io.OutputStreamWriter;
   import java.io.PrintWriter;
   import java.net.InetAddress;
   import java.net.ServerSocket;
  @@ -743,7 +745,7 @@
           // Open an output writer for the new configuration file
           PrintWriter writer = null;
           try {
  -            writer = new PrintWriter(new FileWriter(configNew));
  +            writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(configNew),
"UTF8"));
           } catch (IOException e) {
               if (writer != null) {
                   try {
  @@ -1959,6 +1961,7 @@
                                Server server) throws Exception {
   
           // Store the beginning of this element
  +        writer.println("<?xml version='1.0' encoding='utf-8'?>");
           for (int i = 0; i < indent; i++) {
               writer.print(' ');
           }
  
  
  
  1.2       +6 -6      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java
  
  Index: MemoryUserDatabase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/users/MemoryUserDatabase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MemoryUserDatabase.java	18 Jul 2002 16:47:47 -0000	1.1
  +++ MemoryUserDatabase.java	14 Aug 2002 19:36:17 -0000	1.2
  @@ -506,11 +506,11 @@
   
               // Configure our PrintWriter
               FileOutputStream fos = new FileOutputStream(fileNew);
  -            OutputStreamWriter osw = new OutputStreamWriter(fos);
  +            OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF8");
               writer = new PrintWriter(osw);
   
               // Print the file prolog
  -            writer.println("<?xml version='1.0'?>");
  +            writer.println("<?xml version='1.0' encoding='utf-8'?>");
               writer.println("<tomcat-users>");
   
               // Print entries for each defined role, group, and user
  
  
  

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


Mime
View raw message