更新时间:2023-02-23 10:01:01
2019 年,URI.encode 已过时,不应使用.
In 2019, URI.encode is obsolete and should not be used.
require 'uri'
URI.encode("Hello there world")
#=> "Hello%20there%20world"
URI.encode("hello there: world, how are you")
#=> "hello%20there:%20world,%20how%20are%20you"
URI.decode("Hello%20there%20world")
#=> "Hello there world"