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 the above example, [#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>] means a converter from ISO-8859-1 to UTF-8. âcrlf_newlineâ means newline converter from LF to CRLF.

doc_ruby_on_rails
2015-04-04 18:36:31
Comments
Leave a Comment

Please login to continue.