class HTTP::Response::Body

def find_encoding(encoding)

Retrieve encoding by name. If encoding cannot be found, default to binary.
def find_encoding(encoding)
  Encoding.find encoding
rescue ArgumentError
  Encoding::BINARY
end