axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glyn Normington" <glyn_norming...@uk.ibm.com>
Subject [PATCH] client-side HTTP character encoding
Date Fri, 07 Dec 2001 14:34:55 GMT
Here's the same patch hopefully without line wrapping:

Glyn
Index: xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java,v
retrieving revision 1.12
diff -u -r1.12 HTTPConstants.java
--- xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java     2001/11/25 19:05:06
1.12
+++ xml-axis/java/src/org/apache/axis/transport/http/HTTPConstants.java     2001/12/07 13:42:02
@@ -112,4 +112,8 @@
     public static String MC_HTTP_SERVLETRESPONSE= "transport.http.servletResponse";
     public static String MC_HTTP_SERVLETLOCATION= "transport.http.servletLocation";
     public static String MC_HTTP_SERVLETPATHINFO= "transport.http.servletPathInfo";
+
+    /** HTTP header field values
+     */
+    public static final String HEADER_DEFAULT_CHAR_ENCODING = "iso-8859-1";
 }
Index: xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java,v
retrieving revision 1.38
diff -u -r1.38 HTTPSender.java
--- xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java   2001/12/03 22:49:24
1.38
+++ xml-axis/java/src/org/apache/axis/transport/http/HTTPSender.java   2001/12/07 13:42:17
@@ -315,7 +315,7 @@

             header.append("\r\n");

-            out.write( header.toString().getBytes() );
+            out.write( header.toString().getBytes(HTTPConstants.HEADER_DEFAULT_CHAR_ENCODING)
);
             reqMessage.writeContentToStream(out);
             out.flush();

@@ -366,15 +366,15 @@
                         buf.close();
                         byte[]hdata= buf.toByteArray();
                         buf.reset();
-                        name = new String( hdata, 0, colonIndex );
-                        value = new String( hdata, colonIndex+1, len-1-colonIndex );
+                        name = new String( hdata, 0, colonIndex, HTTPConstants.HEADER_DEFAULT_CHAR_ENCODING
);
+                        value = new String( hdata, colonIndex+1, len-1-colonIndex, HTTPConstants.HEADER_DEFAULT_CHAR_ENCODING
);
                         colonIndex = -1 ;
                     }
                     else {
                         buf.close();
                         byte[]hdata= buf.toByteArray();
                         buf.reset();
-                        name = new String( hdata, 0, len );
+                        name = new String( hdata, 0, len, HTTPConstants.HEADER_DEFAULT_CHAR_ENCODING
);
                         value = "" ;
                     }

Index: xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java,v
retrieving revision 1.32
diff -u -r1.32 SimpleTargetedChain.java
--- xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java    2001/12/03 22:49:22 1.32
+++ xml-axis/java/src/org/apache/axis/SimpleTargetedChain.java    2001/12/07 13:42:47
@@ -104,7 +104,7 @@
             if ( pivotHandler != null ) pivotHandler.invoke( msgContext );
         }
         catch( Exception e ) {
-            category.error( e );
+            category.error( "SimpleTargetedChain caught exception", e );
             if ( requestHandler != null )
                 requestHandler.undo( msgContext );
             throw AxisFault.makeFault(e);



Mime
View raw message