dlr         2004/05/14 08:47:58

  Modified:    src/java/org/apache/xmlrpc/applet Tag: XMLRPC_1_2_BRANCH
                        SimpleXmlRpcClient.java
  Log:
  * src/java/org/apache/xmlrpc/applet/SimpleXmlRpcClient.java
    XmlWriter.write(byte[]): As there's no overload for
    StringBuffer.append(byte[]) (only an Object overload), iterate
    through the bytes in the input parameter, casting each one to chars.
    This has the possibility of causing problems for multi-byte
    character sets, but at least isn't completely wrong like the
    previous implementation.  Longer term, 28982 should be implemented
    in its place.
  
  Issue: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19746
  Submitted by: Lee Haslup
  Branch: XMLRPC_1_2_BRANCH
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.5   +11 -1     
ws-xmlrpc/src/java/org/apache/xmlrpc/applet/SimpleXmlRpcClient.java
  
  Index: SimpleXmlRpcClient.java
  ===================================================================
  RCS file: 
/home/cvs/ws-xmlrpc/src/java/org/apache/xmlrpc/applet/SimpleXmlRpcClient.java,v
  retrieving revision 1.5.2.4
  retrieving revision 1.5.2.5
  diff -u -u -r1.5.2.4 -r1.5.2.5
  --- SimpleXmlRpcClient.java   14 May 2004 15:24:00 -0000      1.5.2.4
  +++ SimpleXmlRpcClient.java   14 May 2004 15:47:58 -0000      1.5.2.5
  @@ -678,6 +678,10 @@
       /**
        * A quick and dirty XML writer.
        * TODO: Replace with core package's XmlWriter class.
  +     *
  +     * @see <a
  +     * href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28982";>Bugzilla
  +     * bug 28982</a>
        */
       class XmlWriter
       {
  @@ -760,7 +764,13 @@
            */
           public void write(byte[] text)
           {
  -            buf.append(text);
  +            // ### This may cause encoding complications for
  +            // ### multi-byte characters.  This should be properly
  +            // ### fixed by implementing Bugzilla issue 28982.
  +            for (int i = 0; i < text.length; i++)
  +            {
  +                buf.append((char) text[i]);
  +            }
           }
   
           /**
  
  
  

Reply via email to