Methods
D
E
Attributes
[R] encoding

ID —> Encoding name

Instance Public methods
decode(string)
# File lib/rexml/encoding.rb, line 28
def decode(string)
  string.encode(::Encoding::UTF_8, @encoding)
end
encode(string)
# File lib/rexml/encoding.rb, line 24
def encode(string)
  string.encode(@encoding)
end
encoding=(encoding)
# File lib/rexml/encoding.rb, line 6
def encoding=(encoding)
  encoding = encoding.name if encoding.is_a?(Encoding)
  if encoding.is_a?(String)
    original_encoding = encoding
    encoding = find_encoding(encoding)
    unless encoding
      raise ArgumentError, "Bad encoding name #{original_encoding}"
    end
  end
  return false if defined?(@encoding) and encoding == @encoding
  if encoding
    @encoding = encoding.upcase
  else
    @encoding = 'UTF-8'
  end
  true
end