module Seahorse::Util

def uri_escape(string)

def uri_escape(string)
  CGI.escape(string.to_s.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~')
end

def uri_path_escape(path)

def uri_path_escape(path)
  path.gsub(/[^\/]+/) { |part| uri_escape(part) }
end