Skip to content

Commit

Permalink
Assume Encoding support
Browse files Browse the repository at this point in the history
  • Loading branch information
norman committed Jan 5, 2012
1 parent d2a4acd commit 4657934
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions activesupport/lib/active_support/multibyte/chars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ def respond_to?(method, include_private=false)

# 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
Expand Down

0 comments on commit 4657934

Please sign in to comment.