The R Project SVN R

Rev

Rev 82597 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82597 Rev 84678
Line 1... Line 1...
1
% File src/library/base/man/Encoding.Rd
1
% File src/library/base/man/Encoding.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2022 R Core Team
3
% Copyright 1995-2023 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{Encoding}
6
\name{Encoding}
7
\alias{Encoding}
7
\alias{Encoding}
8
\alias{Encoding<-}
8
\alias{Encoding<-}
Line 107... Line 107...
107
  For \code{enc2utf8} encodings are always marked: they are for
107
  For \code{enc2utf8} encodings are always marked: they are for
108
  \code{enc2native} in UTF-8 and Latin-1 locales.
108
  \code{enc2native} in UTF-8 and Latin-1 locales.
109
}
109
}
110
\examples{
110
\examples{
111
## x is intended to be in latin1
111
## x is intended to be in latin1
112
x. <- x <- "fa\xE7ile"
112
x. <- x <- "fran\xE7ais"
113
Encoding(x.) # "unknown" (UTF-8 loc.) | "latin1" (8859-1/CP-1252 loc.) | ....
113
Encoding(x.) # "unknown" (UTF-8 loc.) | "latin1" (8859-1/CP-1252 loc.) | ....
114
Encoding(x) <- "latin1"
114
Encoding(x) <- "latin1"
115
x
115
x
116
xx <- iconv(x, "latin1", "UTF-8")
116
xx <- iconv(x, "latin1", "UTF-8")
117
Encoding(c(x., x, xx))
117
Encoding(c(x., x, xx))