def ensure_utf8_object!(object)
      case object
      when String
        ensure_utf8!(object)
      when Hash
        ensure_utf8_hash!(object)
      when Array
        ensure_utf8_array!(object)
      else
        object
      end
    end
def ensure_utf8_object!(object)
      case object
      when String
        ensure_utf8!(object)
      when Hash
        ensure_utf8_hash!(object)
      when Array
        ensure_utf8_array!(object)
      else
        object
      end
    end
Recursively ensure the correct encoding is being used: