Examples for 'XML::getEncoding'


Determines the encoding for an XML document or node

Aliases: getEncoding getEncoding,XMLInternalDocument-method getEncoding,XMLInternalNode-method getEncoding,ANY-method

Keywords: IO

### ** Examples

  f = system.file("exampleData", "charts.svg", package = "XML")
  doc = xmlParse(f)
  getEncoding(doc)
[1] "ISO-8859-1"
  n = getNodeSet(doc, "//g/text")[[1]]
  getEncoding(n)
[1] "ISO-8859-1"
  f = system.file("exampleData", "iTunes.plist", package = "XML")
  doc = xmlParse(f)
  getEncoding(doc)
[1] "UTF-8"

[Package XML version 3.99-0.10 Index]