class method
URI._decode_uri_component
_decode_uri_component(regexp, str, enc)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/uri/common.rb, line 463
def self._decode_uri_component(regexp, str, enc)
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/.match?(str)
str.b.gsub(regexp, TBLDECWWWCOMP_).force_encoding(enc)
end
Returns a string decoding characters matching regexp from the given URL-encoded string str.