Use String#b

Akinori MUSHA %!s(int64=9) %!d(string=hace) años
padre
commit
11d2ee0a14
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/models/agents/ftpsite_agent.rb

+ 1 - 1
app/models/agents/ftpsite_agent.rb

@@ -196,7 +196,7 @@ module Agents
196 196
     end
197 197
 
198 198
     def uri_path_escape(string)
199
-      str = string.dup.force_encoding(Encoding::ASCII_8BIT)  # string.b in Ruby >=2.0
199
+      str = string.b
200 200
       str.gsub!(/([^A-Za-z0-9\-._~!$&()*+,=@]+)/) { |m|
201 201
         '%' + m.unpack('H2' * m.bytesize).join('%').upcase
202 202
       }