# File lib/active_support/multibyte/chars.rb, line 70 def method_missing(m, *a, &b) begin # Simulate methods with a ! at the end because we can't touch the enclosed string from the handlers. if m.to_s =~ /^(.*)\!$/ result = handler.send($1, @string, *a, &b) if result == @string result = nil else @string.replace result end else result = handler.send(m, @string, *a, &b) end rescue NoMethodError result = @string.send(m, *a, &b) rescue Handlers::EncodingError @string.replace handler.tidy_bytes(@string) retry end if result.kind_of?(String) result.chars else result end end