Update of /cvsroot/xdoclet/xdoclet/core/src/xdoclet/template
In directory sc8-pr-cvs1:/tmp/cvs-serv20223/core/src/xdoclet/template

Modified Files:
        TemplateEngine.java 
Log Message:
Patch submitted by Takashi Okamoto for alternate source file encodings

Index: TemplateEngine.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/template/TemplateEngine.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** TemplateEngine.java 25 May 2003 09:23:01 -0000      1.35
--- TemplateEngine.java 30 Aug 2003 06:24:47 -0000      1.36
***************
*** 8,13 ****
--- 8,15 ----
  import java.io.ByteArrayOutputStream;
  import java.io.File;
+ import java.io.FileOutputStream;
  import java.io.FileWriter;
  import java.io.IOException;
+ import java.io.OutputStreamWriter;
  import java.lang.reflect.InvocationTargetException;
  import java.lang.reflect.Method;
***************
*** 60,63 ****
--- 62,67 ----
      protected transient File output = null;
  
+     protected transient String docEncoding = null;
+ 
      /**
       * The template file currently being processed.
***************
*** 285,288 ****
--- 289,302 ----
  
      /**
+      * set output charset;
+      *
+      * @param string
+      */
+     public void setDocEncoding(String string)
+     {
+         docEncoding = string;
+     }
+ 
+     /**
       * Describe what the method does
       *
***************
*** 376,380 ****
          if (content != null) {
              try {
!                 PrettyPrintWriter out = new PrettyPrintWriter(new BufferedWriter(new 
FileWriter(output)));
  
                  setWriter(out);
--- 390,412 ----
          if (content != null) {
              try {
!                 String encoding = docEncoding;
! 
!                 if (encoding == null) {
!                     encoding = _xJavaDoc.getDocEncoding();
!                 }
! 
!                 PrettyPrintWriter out = null;
! 
!                 if (encoding == null) {
!                     out = new PrettyPrintWriter(
!                         new BufferedWriter(new FileWriter(output)));
!                 }
!                 else {
!                     out = new PrettyPrintWriter(
!                         new BufferedWriter(
!                         new OutputStreamWriter(
!                         new FileOutputStream(output),
!                         encoding)));
!                 }
  
                  setWriter(out);



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to