diff --git a/lib/uri/common.rb b/lib/uri/common.rb index 764f89d..4fed901 100644 --- a/lib/uri/common.rb +++ b/lib/uri/common.rb @@ -376,7 +376,7 @@ def self.encode_www_form_component(str, enc=nil) 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