Module: REXML::Encoding

Included in:
Output, Source, XMLDecl
Defined in:
lib/rexml/encoding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encodingObject

ID —> Encoding name



6
7
8
# File 'lib/rexml/encoding.rb', line 6

def encoding
  @encoding
end

Instance Method Details

#decode(string) ⇒ Object



29
30
31
# File 'lib/rexml/encoding.rb', line 29

def decode(string)
  string.encode(::Encoding::UTF_8, @encoding)
end

#encode(string) ⇒ Object



25
26
27
# File 'lib/rexml/encoding.rb', line 25

def encode(string)
  string.encode(@encoding)
end