You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/04/30 15:03:01 UTC

cvs commit: ws-axis/java/src/org/apache/axis/utils tcpmon.java

dims        2005/04/30 06:03:01

  Modified:    java/src/org/apache/axis/utils tcpmon.java
  Log:
  Fix for AXIS-1887 -  tcpmon unable to display messages: faulty lookup of encoding
  
  Revision  Changes    Path
  1.59      +13 -4     ws-axis/java/src/org/apache/axis/utils/tcpmon.java
  
  Index: tcpmon.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/tcpmon.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- tcpmon.java	17 Feb 2005 08:54:23 -0000	1.58
  +++ tcpmon.java	30 Apr 2005 13:03:01 -0000	1.59
  @@ -757,7 +757,7 @@
                                   tmpbuffer[i2++] = buffer[i1];
                               }
                           }
  -                        message = new String( tmpbuffer, 0, i2, XMLUtils.getEncoding() );
  +                        message = new String( tmpbuffer, 0, i2, getEncoding() );
                           if (numericEnc) {
                               textArea.append( StringUtils.escapeNumericChar(message) );
                           } else {
  @@ -770,7 +770,7 @@
                           }
                       }
                       else {
  -                        message = new String( buffer, 0, len, XMLUtils.getEncoding() );
  +                        message = new String( buffer, 0, len, getEncoding() );
                           if (numericEnc) {
                               textArea.append( StringUtils.escapeNumericChar(message) );
                           } else {
  @@ -786,8 +786,8 @@
               // we'll let the other side control when we're done
               //      if ( inSocket != null ) done = true ;
               }
  -            catch ( Exception e ) {
  -                e.printStackTrace();
  +            catch ( Throwable t ) {
  +                t.printStackTrace();
               }
               finally {
                   done = true ;
  @@ -822,6 +822,15 @@
               }
           }
   
  +        private String getEncoding() {
  +            try {
  +            return XMLUtils.getEncoding();
  +
  +            } catch (Throwable t){
  +                return "UTF-8";
  +            }
  +        }
  +        
           public  void halt() {
               try {
                   if ( inSocket != null ) {