class method
URI.encode_uri_component
(::String str, ?::encoding enc) -> ::String
encode_uri_component(str, enc=nil)
lib/uri/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/uri/common.rb, line 436
def self.encode_uri_component(str, enc=nil)
_encode_uri_component(/[^*\-.0-9A-Z_a-z]/, TBLENCURICOMP_, str, enc)
end
Like URI.encode_www_form_component, except that ' ' (space) is encoded as '%20' (instead of '+').
See also
._encode_uri_component
.encode_www_form
.decode_www_form_component
.encode_www_form_component
also in
4.1 · 3.4 · 3.3 · 3.2