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



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

def encoding
  @encoding
end

Instance Method Details

#decode(string) ⇒ Object



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

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

#encode(string) ⇒ Object



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

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