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

block_params: 
comment: 
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: "possible options elements:"
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "  hash form:\n    :invalid =&gt; nil            # raise error on invalid byte sequence (default)\n    :invalid =&gt; :replace       # replace invalid byte sequence\n    :undef =&gt; nil              # raise error on undefined conversion (default)\n    :undef =&gt; :replace         # replace undefined conversion\n    :replace =&gt; string         # replacement string (&quot;?&quot; or &quot;\\uFFFD&quot; if not specified)\n    :universal_newline =&gt; true # decorator for converting CRLF and CR to LF\n    :crlf_newline =&gt; true      # decorator for converting LF to CRLF\n    :cr_newline =&gt; true        # decorator for converting LF to CR\n    :xml =&gt; :text              # escape as XML CharData.\n    :xml =&gt; :attr              # escape as XML AttValue\n  integer form:\n    Encoding::Converter::INVALID_REPLACE\n    Encoding::Converter::UNDEF_REPLACE\n    Encoding::Converter::UNDEF_HEX_CHARREF\n    Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR\n    Encoding::Converter::CRLF_NEWLINE_DECORATOR\n    Encoding::Converter::CR_NEWLINE_DECORATOR\n    Encoding::Converter::XML_TEXT_DECORATOR\n    Encoding::Converter::XML_ATTR_CONTENT_DECORATOR\n    Encoding::Converter::XML_ATTR_QUOTE_DECORATOR\n"
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Encoding::Converter.new creates an instance of Encoding::Converter.
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Source_encoding and destination_encoding should be a string or Encoding object.
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: opt should be nil, a hash or an integer.
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: convpath should be an array. convpath may contain
- !ruby/object:RDoc::Markup::Flow::LIST 
  contents: 
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: "-"
    :body: two-element arrays which contain encodings or encoding names, or
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: "-"
    :body: strings representing decorator names.
  type: :BULLET
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: Encoding::Converter.new optionally takes an option. The option should be a hash or an integer. The option hash can contain :invalid =&gt; nil, etc. The option integer should be logical-or of constants such as Encoding::Converter::INVALID_REPLACE, etc.
- !ruby/object:RDoc::Markup::Flow::LIST 
  contents: 
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":invalid => nil"
    :body: Raise error on invalid byte sequence. This is a default behavior.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":invalid => :replace"
    :body: Replace invalid byte sequence by replacement string.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":undef => nil"
    :body: Raise an error if a character in source_encoding is not defined in destination_encoding. This is a default behavior.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":undef => :replace"
    :body: Replace undefined character in destination_encoding with replacement string.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":replace => string"
    :body: Specify the replacement string. If not specified, &quot;\uFFFD&quot; is used for Unicode encodings and &quot;?&quot; for others.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":universal_newline => true"
    :body: Convert CRLF and CR to LF.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":crlf_newline => true"
    :body: Convert LF to CRLF.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":cr_newline => true"
    :body: Convert LF to CR.
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":xml => :text"
    :body: "Escape as XML CharData. This form can be used as a HTML 4.0 #PCDATA."
  - !ruby/object:RDoc::Markup::Flow::LIST 
    contents: 
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&amp;' -&gt; '&amp;amp;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&lt;' -&gt; '&amp;lt;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&gt;' -&gt; '&amp;gt;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: undefined characters in destination_encoding -&gt; hexadecimal CharRef such as &amp;#xHH;
    type: :BULLET
  - !ruby/struct:RDoc::Markup::Flow::LI 
    :label: ":xml => :attr"
    :body: Escape as XML AttValue. The converted result is quoted as &quot;...&quot;. This form can be used as a HTML 4.0 attribute value.
  - !ruby/object:RDoc::Markup::Flow::LIST 
    contents: 
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&amp;' -&gt; '&amp;amp;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&lt;' -&gt; '&amp;lt;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&gt;' -&gt; '&amp;gt;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: "'&quot;' -&gt; '&amp;quot;'"
    - !ruby/struct:RDoc::Markup::Flow::LI 
      :label: "-"
      :body: undefined characters in destination_encoding -&gt; hexadecimal CharRef such as &amp;#xHH;
    type: :BULLET
  type: :LABELED
- !ruby/struct:RDoc::Markup::Flow::P 
  :body: "Examples:"
- !ruby/struct:RDoc::Markup::Flow::VERB 
  :body: "  # UTF-16BE to UTF-8\n  ec = Encoding::Converter.new(&quot;UTF-16BE&quot;, &quot;UTF-8&quot;)\n\n  # Usually, decorators such as newline conversion are inserted last.\n  ec = Encoding::Converter.new(&quot;UTF-16BE&quot;, &quot;UTF-8&quot;, :universal_newline =&gt; true)\n  p ec.convpath #=&gt; [[#&lt;Encoding:UTF-16BE&gt;, #&lt;Encoding:UTF-8&gt;],\n                #    &quot;universal_newline&quot;]\n\n  # But, if the last encoding is ASCII incompatible,\n  # decorators are inserted before the last conversion.\n  ec = Encoding::Converter.new(&quot;UTF-8&quot;, &quot;UTF-16BE&quot;, :crlf_newline =&gt; true)\n  p ec.convpath #=&gt; [&quot;crlf_newline&quot;,\n                #    [#&lt;Encoding:UTF-8&gt;, #&lt;Encoding:UTF-16BE&gt;]]\n\n  # Conversion path can be specified directly.\n  ec = Encoding::Converter.new([&quot;universal_newline&quot;, [&quot;EUC-JP&quot;, &quot;UTF-8&quot;], [&quot;UTF-8&quot;, &quot;UTF-16BE&quot;]])\n  p ec.convpath #=&gt; [&quot;universal_newline&quot;,\n                #    [#&lt;Encoding:EUC-JP&gt;, #&lt;Encoding:UTF-8&gt;],\n                #    [#&lt;Encoding:UTF-8&gt;, #&lt;Encoding:UTF-16BE&gt;]]\n"
full_name: Encoding::Converter::new
is_singleton: true
name: new
params: |
  Encoding::Converter.new(source_encoding, destination_encoding)
  Encoding::Converter.new(source_encoding, destination_encoding, opt)
  Encoding::Converter.new(convpath)

visibility: public
