diff --git a/lib/maxmind/request.rb b/lib/maxmind/request.rb index 46a3778..7e7a2ed 100644 --- a/lib/maxmind/request.rb +++ b/lib/maxmind/request.rb @@ -60,7 +60,8 @@ def bin=(bin) def process! resp = post(query) - Maxmind::Response.new(resp.body.encode("utf-8", "iso-8859-1"), resp.code) + to_send = resp.body.respond_to?("encode") ? resp.body.encode("utf-8", "iso-8859-1") : resp.body + Maxmind::Response.new(to_send, resp.code) end def process