Project

General

Profile

Bug #14358 ยป uri_encoding.patch

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

View differences:

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