File: //usr/local/rvm/gems/default/doc/mail-2.7.1/ri/Mail/Multibyte/mb_chars-c.ri
U:RDoc::AnyMethod[iI"
mb_chars:ETI"Mail::Multibyte::mb_chars;TT:publico:RDoc::Markup::Document:@parts[S:RDoc::Markup::Heading:
leveli: textI"Multibyte proxy;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph; [I"=+mb_chars+ is a multibyte safe proxy for string methods.;T@
o;; [I"hIn Ruby 1.8 and older it creates and returns an instance of the Mail::Multibyte::Chars class which ;TI"rencapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy ;TI"lclass. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsuled string.;T@
o:RDoc::Markup::Verbatim; [I"name = 'Claus Müller'
;TI"'name.reverse # => "rell??M sualC"
;TI"name.length # => 13
;TI"
;TI"5name.mb_chars.reverse.to_s # => "rellüM sualC"
;TI"(name.mb_chars.length # => 12
;T:@format0o;; [I"pIn Ruby 1.9 and newer +mb_chars+ returns +self+ because String is (mostly) encoding aware. This means that ;TI"Oit becomes easy to run one version of your code on multiple Ruby versions.;T@
S;
;i;I"Method chaining;T@
o;; [I"oAll the methods on the Chars proxy which normally return a string will return a Chars object. This allows ;TI";method chaining on the result of any of these methods.;T@
o;; [I"*name.mb_chars.reverse.length # => 12
;T;0S;
;i;I"'Interoperability and configuration;T@
o;; [I"tThe Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between ;TI"rString and Char work like expected. The bang! methods change the internal string representation in the Chars ;TI"Qobject. Interoperability problems can be resolved easily with a +to_s+ call.;T@
o;; [I"gFor more information about the methods defined on the Chars proxy see Mail::Multibyte::Chars. For ;TI"Yinformation about how to change the default Multibyte behaviour see Mail::Multibyte.;T:
@fileI"lib/mail/multibyte.rb;T:0@omit_headings_from_table_of_contents_below000[ I"
(str);T@6FI"Multibyte;TcRDoc::NormalModule00