markt       2004/10/04 12:42:34

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        JDTCompiler.java
  Log:
  Fix bug 31465. Ensure that the compiler reads the .java file using
  the same encoding as that with which it was written.
  
  Revision  Changes    Path
  1.5       +6 -2      
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JDTCompiler.java
  
  Index: JDTCompiler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JDTCompiler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JDTCompiler.java  9 Sep 2004 21:28:13 -0000       1.4
  +++ JDTCompiler.java  4 Oct 2004 19:42:33 -0000       1.5
  @@ -20,11 +20,12 @@
   import java.io.BufferedReader;
   import java.io.ByteArrayOutputStream;
   import java.io.File;
  +import java.io.FileInputStream;
   import java.io.FileNotFoundException;
   import java.io.FileOutputStream;
  -import java.io.FileReader;
   import java.io.IOException;
   import java.io.InputStream;
  +import java.io.InputStreamReader;
   import java.io.Reader;
   import java.util.ArrayList;
   import java.util.HashMap;
  @@ -109,7 +110,10 @@
               public char[] getContents() {
                   char[] result = null;
                   try {
  -                    Reader reader = new BufferedReader(new FileReader(sourceFile));
  +                    InputStreamReader isReader =
  +                        new InputStreamReader(new FileInputStream(sourceFile),
  +                                ctxt.getOptions().getJavaEncoding());
  +                    Reader reader = new BufferedReader(isReader);
                       if (reader != null) {
                           char[] chars = new char[8192];
                           StringBuffer buf = new StringBuffer();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to