U:RDoc::AnyMethod[iI"new:ETI"Encoding::Converter::new;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"possible options elements:;To:RDoc::Markup::Verbatim; [I"hash form: ;TI"S :invalid => nil # raise error on invalid byte sequence (default) ;TI"B :invalid => :replace # replace invalid byte sequence ;TI"R :undef => nil # raise error on undefined conversion (default) ;TI"A :undef => :replace # replace undefined conversion ;TI"Z :replace => string # replacement string ("?" or "\uFFFD" if not specified) ;TI"O :newline => :universal # decorator for converting CRLF and CR to LF ;TI"H :newline => :crlf # decorator for converting LF to CRLF ;TI"F :newline => :cr # decorator for converting LF to CR ;TI"O :universal_newline => true # decorator for converting CRLF and CR to LF ;TI"H :crlf_newline => true # decorator for converting LF to CRLF ;TI"F :cr_newline => true # decorator for converting LF to CR ;TI"< :xml => :text # escape as XML CharData. ;TI"; :xml => :attr # escape as XML AttValue ;TI"integer form: ;TI", Encoding::Converter::INVALID_REPLACE ;TI"* Encoding::Converter::UNDEF_REPLACE ;TI". Encoding::Converter::UNDEF_HEX_CHARREF ;TI"8 Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR ;TI"3 Encoding::Converter::CRLF_NEWLINE_DECORATOR ;TI"1 Encoding::Converter::CR_NEWLINE_DECORATOR ;TI"/ Encoding::Converter::XML_TEXT_DECORATOR ;TI"7 Encoding::Converter::XML_ATTR_CONTENT_DECORATOR ;TI"5 Encoding::Converter::XML_ATTR_QUOTE_DECORATOR ;T: @format0o; ; [I"HEncoding::Converter.new creates an instance of Encoding::Converter.;To:RDoc::Markup::BlankLineo; ; [I"DSource_encoding and destination_encoding should be a string or ;TI"Encoding object.;T@+o; ; [I"-opt should be nil, a hash or an integer.;T@+o; ; [I""convpath should be an array. ;TI"convpath may contain;To:RDoc::Markup::List: @type: BULLET: @items[o:RDoc::Markup::ListItem: @label0; [o; ; [I"Etwo-element arrays which contain encodings or encoding names, or;To;;0; [o; ; [I"*strings representing decorator names.;T@+o; ; [ I"9Encoding::Converter.new optionally takes an option. ;TI"0The option should be a hash or an integer. ;TI"7The option hash can contain :invalid => nil, etc. ;TI"BThe option integer should be logical-or of constants such as ;TI"/Encoding::Converter::INVALID_REPLACE, etc.;T@+o;;: LABEL;[o;;[I":invalid => nil;T; [o; ; [I"GRaise error on invalid byte sequence. This is a default behavior.;To;;[I":invalid => :replace;T; [o; ; [I"9Replace invalid byte sequence by replacement string.;To;;[I":undef => nil;T; [o; ; [I"^Raise an error if a character in source_encoding is not defined in destination_encoding. ;TI" This is a default behavior.;To;;[I":undef => :replace;T; [o; ; [I"QReplace undefined character in destination_encoding with replacement string.;To;;[I":replace => string;T; [o; ; [I"%Specify the replacement string. ;TI"QIf not specified, "\uFFFD" is used for Unicode encodings and "?" for others.;To;;[I":universal_newline => true;T; [o; ; [I"Convert CRLF and CR to LF.;To;;[I":crlf_newline => true;T; [o; ; [I"Convert LF to CRLF.;To;;[I":cr_newline => true;T; [o; ; [I"Convert LF to CR.;To;;[I":xml => :text;T; [o; ; [I"Escape as XML CharData. ;TI"2This form can be used as an HTML 4.0 #PCDATA.;To;;;;[ o;;0; [o; ; [I"'&' -> '&';To;;0; [o; ; [I"'<' -> '<';To;;0; [o; ; [I"'>' -> '>';To;;0; [o; ; [I"Wundefined characters in destination_encoding -> hexadecimal CharRef such as &#xHH;;To;;[I":xml => :attr;T; [o; ; [I"Escape as XML AttValue. ;TI".The converted result is quoted as "...". ;TI":This form can be used as an HTML 4.0 attribute value.;To;;;;[ o;;0; [o; ; [I"'&' -> '&';To;;0; [o; ; [I"'<' -> '<';To;;0; [o; ; [I"'>' -> '>';To;;0; [o; ; [I"'"' -> '"';To;;0; [o; ; [I"Wundefined characters in destination_encoding -> hexadecimal CharRef such as &#xHH;;T@+o; ; [I"Examples:;To; ; [I"# UTF-16BE to UTF-8 ;TI"7ec = Encoding::Converter.new("UTF-16BE", "UTF-8") ;TI" ;TI"I# Usually, decorators such as newline conversion are inserted last. ;TI"Sec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true) ;TI"Cp ec.convpath #=> [[#, #], ;TI"- # "universal_newline"] ;TI" ;TI"8# But, if the last encoding is ASCII incompatible, ;TI";# decorators are inserted before the last conversion. ;TI"Nec = Encoding::Converter.new("UTF-8", "UTF-16BE", :crlf_newline => true) ;TI"(p ec.convpath #=> ["crlf_newline", ;TI"C # [#, #]] ;TI" ;TI"2# Conversion path can be specified directly. ;TI"eec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]]) ;TI"-p ec.convpath #=> ["universal_newline", ;TI"A # [#, #], ;TI"B # [#, #]];T; 0: @fileI"transcode.c;T:0@omit_headings_from_table_of_contents_below0I"¥Encoding::Converter.new(source_encoding, destination_encoding) Encoding::Converter.new(source_encoding, destination_encoding, opt) Encoding::Converter.new(convpath) ;T0[I" (*args);T@ÛFI"Converter;TcRDoc::NormalClass00