Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
URI::RFC2396_Parser#unescape
unescape( str )
unescape( str, escaped )
lib/uri/rfc2396_parser.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/uri/rfc2396_parser.rb, line 318
def unescape(str, escaped = @regexp[:ESCAPED])
enc = str.encoding
enc = Encoding::UTF_8 if enc == Encoding::US_ASCII
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
end