module Bundler::URI

def self.decode_www_form_component(str, enc=Encoding::UTF_8)

See Bundler::URI.encode_www_form_component, Bundler::URI.decode_www_form.

This decodes + to SP.

Decodes given +str+ of URL-encoded form data.
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
  raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/ =~ str
  str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
end