getEncoding

0th

Percentile

Determines the encoding for an XML document or node

This function and its methods are intended to return the encoding of n XML . It is similar to Encoding but currently restricted to XML nodes and documents.

Keywords
IO
Usage
getEncoding(obj, ...)
Arguments
obj

the object whose encoding is being queried.

any additional parameters which can be customized by the methods.

Value

A character vector of length 1 giving the encoding of the XML document.

Aliases
  • getEncoding
  • getEncoding,XMLInternalDocument-method
  • getEncoding,XMLInternalNode-method
  • getEncoding,ANY-method
Examples
# NOT RUN {
  f = system.file("exampleData", "charts.svg", package = "XML")
  doc = xmlParse(f)
  getEncoding(doc)
  n = getNodeSet(doc, "//g/text")[[1]]
  getEncoding(n)

  f = system.file("exampleData", "iTunes.plist", package = "XML")
  doc = xmlParse(f)
  getEncoding(doc)
# }
Documentation reproduced from package XML, version 3.99-0.3, License: BSD_3_clause + file LICENSE

Community examples

Looks like there are no examples yet.