aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte/chars.rb
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2012-01-05 16:21:59 -0300
committerNorman Clarke <norman@njclarke.com>2012-01-05 16:21:59 -0300
commit46579340c0847c433c0f9c3f46c79cd4521d9234 (patch)
treea40fd6082ef88551300d56374928e29f576536ea /activesupport/lib/active_support/multibyte/chars.rb
parentd2a4acdbe3027e447c888558bb36d1aef2bfccf9 (diff)
downloadrails-46579340c0847c433c0f9c3f46c79cd4521d9234.tar.gz
rails-46579340c0847c433c0f9c3f46c79cd4521d9234.tar.bz2
rails-46579340c0847c433c0f9c3f46c79cd4521d9234.zip
Assume Encoding support
Diffstat (limited to 'activesupport/lib/active_support/multibyte/chars.rb')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb6
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