End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
URI.decode_www_form_component
decode_www_form_component(str, enc=Encoding::UTF_8)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/uri/common.rb, line 340
def self.decode_www_form_component(str, enc=Encoding::UTF_8)
raise ArgumentError, "invalid %-encoding (#{str})" if /%(?!\h\h)/.match?(str)
str.b.gsub(/\+|%\h\h/, TBLDECWWWCOMP_).force_encoding(enc)
end
Decodes given str of URL-encoded form data.
This decodes + to SP.
See also
.decode_www_form
.encode_www_form
.encode_www_form_component
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0