Project

General

Profile

Bug #14358 » uri_encoding.patch

phluid61 (Matthew Kerwin), 01/15/2018 11:52 AM

View differences:

lib/uri/common.rb
if str.encoding != Encoding::ASCII_8BIT
if enc && enc != Encoding::ASCII_8BIT
str.encode!(Encoding::UTF_8, invalid: :replace, undef: :replace)
str.encode!(enc, fallback: ->(x){"&#{x.ord};"})
str.encode!(enc, fallback: ->(x){"&##{x.ord};"})
end
str.force_encoding(Encoding::ASCII_8BIT)
end
(1-1/2)