diff options
author | Norman Clarke <norman@njclarke.com> | 2012-01-05 16:21:59 -0300 |
---|---|---|
committer | Norman Clarke <norman@njclarke.com> | 2012-01-05 16:21:59 -0300 |
commit | 46579340c0847c433c0f9c3f46c79cd4521d9234 (patch) | |
tree | a40fd6082ef88551300d56374928e29f576536ea /activesupport | |
parent | d2a4acdbe3027e447c888558bb36d1aef2bfccf9 (diff) | |
download | rails-46579340c0847c433c0f9c3f46c79cd4521d9234.tar.gz rails-46579340c0847c433c0f9c3f46c79cd4521d9234.tar.bz2 rails-46579340c0847c433c0f9c3f46c79cd4521d9234.zip |
Assume Encoding support
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 90544a2e64..1505d3e604 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -66,11 +66,7 @@ module ActiveSupport #:nodoc: # Returns +true+ when the proxy class can handle the string. Returns +false+ otherwise. def self.consumes?(string) - # Unpack is a little bit faster than regular expressions. - string.unpack('U*') - true - rescue ArgumentError - false + string.encoding == Encoding::UTF_8 end include Comparable |