Index: src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
===================================================================
--- src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java	(revision 687093)
+++ src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java	(working copy)
@@ -19,9 +19,7 @@
  */
 package com.ecyrd.jspwiki.ui;
 
-import java.io.CharArrayWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.*;
 
 import javax.servlet.*;
 import javax.servlet.http.HttpServletRequest;
@@ -225,6 +223,9 @@
     /**
      *  Simple response wrapper that just allows us to gobble through the entire
      *  response before it's output.
+     *  Modified so that it uses a ByteArrayOutputStream instead of a CharArrayWriter
+     *  Workaround for Oracle Container for J2EE (OC4J 10.1.3.1)
+     *  ltietze
      *  
      *  @author jalkanen
      */
@@ -231,7 +232,8 @@
     private static class MyServletResponseWrapper
         extends HttpServletResponseWrapper
     {
-        private CharArrayWriter m_output;
+        private ByteArrayOutputStream m_output;
+        private HttpServletResponse m_response;
       
         /** 
          *  How large the initial buffer should be.  This should be tuned to achieve
@@ -242,9 +244,10 @@
         public MyServletResponseWrapper( HttpServletResponse r )
         {
             super(r);
-            m_output = new CharArrayWriter( INIT_BUFFER_SIZE );
+            m_output = new ByteArrayOutputStream( INIT_BUFFER_SIZE );
+            m_response = r;
         }
-
+        
         /**
          *  Returns a writer for output; this wraps the internal buffer
          *  into a PrintWriter.
@@ -251,7 +254,7 @@
          */
         public PrintWriter getWriter()
         {
-            return new PrintWriter( m_output );
+            return new PrintWriter( getOutputStream(), true );
         }
 
         public ServletOutputStream getOutputStream()
@@ -261,19 +264,18 @@
 
         class MyServletOutputStream extends ServletOutputStream
         {
-            CharArrayWriter m_buffer;
+            private DataOutputStream m_stream;
 
-            public MyServletOutputStream(CharArrayWriter aCharArrayWriter)
+            public MyServletOutputStream( OutputStream aOutput )
             {
                 super();
-                m_buffer = aCharArrayWriter;
+                m_stream = new DataOutputStream( aOutput );
             }
 
-            public void write(int aInt)
+            public void write( int aInt ) throws IOException
             {
-                m_buffer.write( aInt );
+                m_stream.write( aInt );
             }
-
         }
         
         /**
@@ -281,7 +283,15 @@
          */
         public String toString()
         {
-            return m_output.toString();
+            try
+            {
+                return m_output.toString( m_response.getCharacterEncoding() );
+            }
+            catch( UnsupportedEncodingException e )
+            {
+                log.error( MyServletResponseWrapper.class + " Unsupported Encoding", e );
+                return null;
+            }
         }
     }
 
