Skip to content

Commit

Permalink
call encode! directly after force_encoding to play
Browse files Browse the repository at this point in the history
nice with the internal encoding
  • Loading branch information
rkh committed Jun 5, 2011
1 parent 42b8056 commit 4511114
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ def force_encoding(*args) settings.force_encoding(*args) end
def self.force_encoding(data, encoding = default_encoding)
return if data == settings || data.is_a?(Tempfile)
if data.respond_to? :force_encoding
data.force_encoding encoding
data.force_encoding(encoding).encode!
elsif data.respond_to? :each_value
data.each_value { |v| force_encoding(v, encoding) }
elsif data.respond_to? :each
Expand Down

0 comments on commit 4511114

Please sign in to comment.