getEncoding: Determines the encoding for an XML document or node

Description Usage Arguments Value Author(s) Examples

Description

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.

Usage

1

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.

Author(s)

Duncan Temple Lang

Examples

1
2
3
4
5
6
7
8
9
  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)

Example output

[1] "ISO-8859-1"
[1] "ISO-8859-1"
[1] "UTF-8"

XML documentation built on Sept. 17, 2021, 9:06 a.m.

Related to getEncoding in XML...