diff --git a/lib/paperclip/url_generator.rb b/lib/paperclip/url_generator.rb index 83f784979..b82e6cffd 100644 --- a/lib/paperclip/url_generator.rb +++ b/lib/paperclip/url_generator.rb @@ -65,7 +65,9 @@ def escape_url(url) if url.respond_to?(:escape) url.escape else - URI.escape(url).gsub(escape_regex){|m| "%#{m.ord.to_s(16).upcase}" } + URI.encode_www_form_component(url).gsub(escape_regex) { + |m| "%#{m.ord.to_s(16).upcase}" + } end end