[#7708] Bug in libsnmp-ruby1.8 — Hadmut Danisch <hadmut@...>

Hi,

8 messages 2006/04/11
[#7709] Re: Bug in libsnmp-ruby1.8 — Eric Hodel <drbrain@...7.net> 2006/04/11

On Apr 11, 2006, at 6:23 AM, Hadmut Danisch wrote:

[#7770] Re: possible defect in array.c — "Brown, Warren" <warrenbrown@...>

> rb_range_beg_len (in range.c) does set beg and len.

13 messages 2006/04/26
[#7771] Re: possible defect in array.c — "Pat Eyler" <rubypate@...> 2006/04/26

On 4/26/06, Brown, Warren <warrenbrown@aquire.com> wrote:

xmlrpc and charset=utf-8

From: "Phil Tomson" <rubyfan@...>
Date: 2006-04-17 23:42:52 UTC
List: ruby-core #7729
I'm needed to interact with an XMLRPC server written using the
xmlrpc-c library for C/C++.  I was using Ruby 1.8.4 and found that I
could not get a simple xmlrpc client written in Ruby that would
communicate with the xmlrpc-c server.

I kept getting the following error:
  /usr/local/lib/ruby/1.8/xmlrpc/client.rb:547:in `do_rpc':
HTTP-Error: 400 Bad Request   (RuntimeError)
        from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2'
        from /usr/local/lib/ruby/1.8/xmlrpc/client.rb:410:in `call'
        from littleclient.rb:7


I tried downgrading to Ruby 1.8.2 and it worked fine.

When I investigated the difference I found the following in the
xmlrpc/client.rb file that comes with Ruby 1.8.4:
    def do_rpc(request, async=false)
      header = {
       "User-Agent"     =>  USER_AGENT,
       "Content-Type"   => "text/xml; charset=utf-8",
       "Content-Length" => request.size.to_s,
       "Connection"     => (async ? "close" : "keep-alive")
      }

This differs from the client.rb included with Ruby 1.8.2:

      def do_rpc(request, async=false)
        header = {
         "User-Agent"     =>  USER_AGENT,
         "Content-Type"   => "text/xml ",
         "Content-Length" => request.size.to_s,
         "Connection"     => (async ? "close" : "keep-alive")
        }

so I changed the code in the 1.8.4 version of client.rb to remove the
"charset=utf-8" - after that the ruby client interacted fine with the
xmlrpc-c server.

I'm wondering if utf-8 should be the default charset for Ruby's xmlrpc
client implementation?  Also, I'm wondering if perhaps it could be
selectable by adding an accessor method to the client to the Client
class?

Phil


In This Thread

Prev Next