diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/uri.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb index dadabb02e5..cdd81ae562 100644 --- a/activesupport/lib/active_support/core_ext/uri.rb +++ b/activesupport/lib/active_support/core_ext/uri.rb @@ -1,17 +1,8 @@ # frozen_string_literal: true require "uri" -str = "\xE6\x97\xA5" -parser = URI::Parser.new -needs_monkeypatch = - begin - str + str != parser.unescape(str + parser.escape(str).force_encoding(Encoding::UTF_8)) - rescue Encoding::CompatibilityError - true - end - -if needs_monkeypatch +if RUBY_VERSION < "2.6.0" require "active_support/core_ext/module/redefine_method" URI::Parser.class_eval do silence_redefinition_of_method :unescape |