diff options
author | Sergey Nartimov <just.lest@gmail.com> | 2011-12-24 15:57:54 +0300 |
---|---|---|
committer | Sergey Nartimov <just.lest@gmail.com> | 2011-12-24 15:57:54 +0300 |
commit | 5ca86ac8f924b333a5a01a47cc07cbcf39c16e80 (patch) | |
tree | da7a9a4d9cd8ad05648bde5d283715d5feea4d81 /actionpack/lib/action_dispatch/http | |
parent | a5fa310f406e299a1ac54d1a227bde93b7ce282b (diff) | |
download | rails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.tar.gz rails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.tar.bz2 rails-5ca86ac8f924b333a5a01a47cc07cbcf39c16e80.zip |
deprecate String#encoding_aware? and remove its usage
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameters.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/http/upload.rb | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb index ef5d207b26..d9b63faf5e 100644 --- a/actionpack/lib/action_dispatch/http/parameters.rb +++ b/actionpack/lib/action_dispatch/http/parameters.rb @@ -41,8 +41,6 @@ module ActionDispatch # you'll get a weird error down the road, but our form handling # should really prevent that from happening def encode_params(params) - return params unless "ruby".encoding_aware? - if params.is_a?(String) return params.force_encoding("UTF-8").encode! elsif !params.is_a?(Hash) diff --git a/actionpack/lib/action_dispatch/http/upload.rb b/actionpack/lib/action_dispatch/http/upload.rb index 94fa747a79..5ab99d1061 100644 --- a/actionpack/lib/action_dispatch/http/upload.rb +++ b/actionpack/lib/action_dispatch/http/upload.rb @@ -22,8 +22,8 @@ module ActionDispatch private def encode_filename(filename) - # Encode the filename in the utf8 encoding, unless it is nil or we're in 1.8 - if "ruby".encoding_aware? && filename + # Encode the filename in the utf8 encoding, unless it is nil + if filename filename.force_encoding("UTF-8").encode! else filename |