mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
Override incompatible 1.8.7p1 String#chars
This commit is contained in:
@@ -4,6 +4,12 @@ module ActiveSupport #: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
|
||||
|
||||
Reference in New Issue
Block a user