aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/unicode.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/unicode.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/unicode.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/unicode.rb b/activesupport/lib/active_support/core_ext/string/unicode.rb
index 0e9770af25..1f50773505 100644
--- a/activesupport/lib/active_support/core_ext/string/unicode.rb
+++ b/activesupport/lib/active_support/core_ext/string/unicode.rb
@@ -1,9 +1,15 @@
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module String #:nodoc:
- if RUBY_VERSION < '1.9'
+ 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