From f8fb627e908f2c66942259790e92ee1f5179e15c Mon Sep 17 00:00:00 2001 From: Alexandre ZANNI <16578570+noraj@users.noreply.github.com> Date: Sat, 14 Oct 2023 14:16:13 +0200 Subject: [PATCH] doc: fix method name there was probably a copy paste mistake in the example of unescapeURIComponent (copied from unescape) --- lib/cgi/util.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cgi/util.rb b/lib/cgi/util.rb index 5f33589..8b129a4 100644 --- a/lib/cgi/util.rb +++ b/lib/cgi/util.rb @@ -36,7 +36,7 @@ def unescape(string, encoding = @@accept_charset) # URL-encode a string following RFC 3986 # Space characters (+" "+) are encoded with (+"%20"+) - # url_encoded_string = CGI.escape("'Stop!' said Fred") + # url_encoded_string = CGI.escapeURIComponent("'Stop!' said Fred") # # => "%27Stop%21%27%20said%20Fred" def escapeURIComponent(string) encoding = string.encoding @@ -48,7 +48,7 @@ def escapeURIComponent(string) end # URL-decode a string following RFC 3986 with encoding(optional). - # string = CGI.unescape("%27Stop%21%27+said%20Fred") + # string = CGI.unescapeURIComponent("%27Stop%21%27+said%20Fred") # # => "'Stop!'+said Fred" def unescapeURIComponent(string, encoding = @@accept_charset) str = string.b