From f67b070facef6574df3c4386e3975242273fe456 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 19 Apr 2008 17:16:19 -0700 Subject: [PATCH] Override incompatible 1.8.7p1 String#chars --- activesupport/lib/active_support/core_ext/string/unicode.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activesupport/lib/active_support/core_ext/string/unicode.rb b/activesupport/lib/active_support/core_ext/string/unicode.rb index 963920d4a6950..1f5077350511c 100644 --- a/activesupport/lib/active_support/core_ext/string/unicode.rb +++ b/activesupport/lib/active_support/core_ext/string/unicode.rb @@ -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