dlr         2004/05/14 08:47:05

  Modified:    src/java/org/apache/xmlrpc/applet 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
  
  Revision  Changes    Path
  1.8       +12 -2     
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.7
  retrieving revision 1.8
  diff -u -u -r1.7 -r1.8
  --- SimpleXmlRpcClient.java   14 May 2004 15:22:53 -0000      1.7
  +++ SimpleXmlRpcClient.java   14 May 2004 15:47:05 -0000      1.8
  @@ -691,6 +691,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
       {
  @@ -773,7 +777,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