convpath

ec.convpath â ary Instance Public methods Returns the conversion path of ec. The result is an array of conversions. ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP", crlf_newline: true) p ec.convpath #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>], # "crlf_newline"] Each element of the array is a pair of encodings or a string. A pair means an encoding conversion. A string means a decorator. In

convert

ec.convert(source_string) â destination_string Instance Public methods Convert source_string and return destination_string. source_string is assumed as a part of source. i.e. :partial_input=>true is specified internally. finish method should be used last. ec = Encoding::Converter.new("utf-8", "euc-jp") puts ec.convert("\u3042").dump #=> "\xA4\xA2" puts ec.finish.dump #=> "" ec = Encoding::Converter.new("euc-jp", "utf-8") puts ec.convert("\xA4").dump

==

ec == other â true or false Instance Public methods

search_convpath

Encoding::Converter.search_convpath(source_encoding, destination_encoding) â aryEncoding::Converter.search_convpath(source_encoding, destination_encoding, opt) â ary Class Public methods Returns a conversion path. p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP") #=> [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>], # [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]] p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_ne

new

Encoding::Converter.new(source_encoding, destination_encoding)Encoding::Converter.new(source_encoding, destination_encoding, opt)Encoding::Converter.new(convpath) Class Public methods possible options elements: hash form: :invalid => nil # raise error on invalid byte sequence (default) :invalid => :replace # replace invalid byte sequence :undef => nil # raise error on undefined conversion (default) :undef => :replace # repl

asciicompat_encoding

Encoding::Converter.asciicompat_encoding(string) â encoding or nilEncoding::Converter.asciicompat_encoding(encoding) â encoding or nil Class Public methods Returns the corresponding ASCII compatible encoding. Returns nil if the argument is an ASCII compatible encoding. âcorresponding ASCII compatible encodingâ is an ASCII compatible encoding which can represents exactly the same characters as the given ASCII incompatible encoding. So, no conversion undefined error occurs when conv

generate

generate(io, from_carrier, to_carrier) Instance Public methods

conversion

conversion(from_carrier, to_carrier, &block) Instance Public methods

new

new(xml_path) Class Public methods

Fail 3

fail(err = nil, *rest) Instance Public methods Alias for: Raise