--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Multibyte proxy
- !ruby/struct:SM::Flow::P 
  body: <tt>mb_chars</tt> is a multibyte safe proxy for string methods.
- !ruby/struct:SM::Flow::P 
  body: In Ruby 1.8 and older 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. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsuled string.
- !ruby/struct:SM::Flow::VERB 
  body: "  name = 'Claus M\xC3\xBCller'\n  name.reverse  #=&gt; &quot;rell??M sualC&quot;\n  name.length   #=&gt; 13\n\n  name.mb_chars.reverse.to_s   #=&gt; &quot;rell\xC3\xBCM sualC&quot;\n  name.mb_chars.length         #=&gt; 12\n"
- !ruby/struct:SM::Flow::P 
  body: In Ruby 1.9 and newer <tt>mb_chars</tt> returns <tt>self</tt> because String is (mostly) encoding aware. This means that it becomes easy to run one version of your code on multiple Ruby versions.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Method chaining
- !ruby/struct:SM::Flow::P 
  body: All the methods on the Chars proxy which normally return a string will return a Chars object. This allows method chaining on the result of any of these methods.
- !ruby/struct:SM::Flow::VERB 
  body: "  name.mb_chars.reverse.length #=&gt; 12\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Interoperability and configuration
- !ruby/struct:SM::Flow::P 
  body: "The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between String and Char work like expected. The bang! methods change the internal string representation in the Chars object. Interoperability problems can be resolved easily with a <tt>to_s</tt> call."
- !ruby/struct:SM::Flow::P 
  body: For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For information about how to change the default Multibyte behaviour see ActiveSupport::Multibyte.
full_name: ActiveSupport::CoreExtensions::String::Multibyte#mb_chars
is_singleton: false
name: mb_chars
params: ()
visibility: public
