Skip to content

Commit

Permalink
Override incompatible 1.8.7p1 String#chars
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Apr 20, 2008
1 parent 715db1a commit f67b070
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions activesupport/lib/active_support/core_ext/string/unicode.rb
Expand Up @@ -4,6 +4,12 @@ module String #:nodoc:
unless '1.9'.respond_to?(:force_encoding)
# Define methods for handling unicode data.
module Unicode
def self.included(base)
if '1.8.7'.respond_to?(:chars)
base.class_eval { remove_method :chars }
end
end

# +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the
# ActiveSupport::Multibyte::Chars class which encapsulates the original string. A Unicode safe version of all
# the String methods are defined on this proxy class. Undefined methods are forwarded to String, so all of the
Expand Down

0 comments on commit f67b070

Please sign in to comment.