Rev 40696 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{Encoding}\encoding{latin1}\alias{Encoding}\alias{Encoding<-}\title{Read or Set the Declared Encodings for a Character Vector}\description{Read or set the declared encodings for a character vector.}\usage{Encoding(x)Encoding(x) <- value}\arguments{\item{x}{A character vector.}\item{value}{A character vector of positive length.}}\details{As from \R 2.5.0, character strings in \R can be declared to be in\code{"latin1"} or \code{"UTF-8"}. These declarations can be read by\code{Encoding}, which will return a character vector of values\code{"latin1"}, \code{"UTF-8"} or \code{"unknown"}, or set, when\code{value} is recycled as needed and other values are silentlytreated as \code{"unknown"}.}\value{A character vector.}\examples{## x is intended to be in latin1x <- "fa\xE7ile"Encoding(x)Encoding(x) <- "latin1"xif(capabilities("iconv")) {xx <- iconv(x, "latin1", "UTF-8")print(Encoding(c(x, xx)))c(x, xx)}}\keyword{utilities}\keyword{character}