The R Project SVN R

Rev

Rev 80054 | Rev 80172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80054 Rev 80116
Line 77... Line 77...
77
  \code{\link{sub}} and \code{gsub} will give a marked UTF-8 result if
77
  \code{\link{sub}} and \code{gsub} will give a marked UTF-8 result if
78
  any of the inputs are UTF-8.
78
  any of the inputs are UTF-8.
79
 
79
 
80
  \code{\link{paste}} and \code{\link{sprintf}} return elements marked
80
  \code{\link{paste}} and \code{\link{sprintf}} return elements marked
81
  as bytes if any of the corresponding inputs is marked as bytes, and
81
  as bytes if any of the corresponding inputs is marked as bytes, and
82
  otherwise marked as UTF-8 of any of the inputs is marked as UTF-8.
82
  otherwise marked as UTF-8 if any of the inputs is marked as UTF-8.
83
 
83
 
84
  \code{\link{match}}, \code{\link{pmatch}}, \code{\link{charmatch}},
84
  \code{\link{match}}, \code{\link{pmatch}}, \code{\link{charmatch}},
85
  \code{\link{duplicated}} and \code{\link{unique}} all match in UTF-8
85
  \code{\link{duplicated}} and \code{\link{unique}} all match in UTF-8
86
  if any of the elements are marked as UTF-8.
86
  if any of the elements are marked as UTF-8.
87
 
87
 
Line 100... Line 100...
100
  \code{enc2native} in UTF-8 and Latin-1 locales.
100
  \code{enc2native} in UTF-8 and Latin-1 locales.
101
}
101
}
102
\examples{
102
\examples{
103
## x is intended to be in latin1
103
## x is intended to be in latin1
104
x. <- x <- "fa\xE7ile"
104
x. <- x <- "fa\xE7ile"
105
Encoding(x.) # "unknown" (Linux) | "latin-1" (Win 32 server) | ....
105
Encoding(x.) # "unknown" (Linux) | "latin1" (Win 32 server) | ....
106
Encoding(x) <- "latin1"
106
Encoding(x) <- "latin1"
107
x
107
x
108
xx <- iconv(x, "latin1", "UTF-8")
108
xx <- iconv(x, "latin1", "UTF-8")
109
Encoding(c(x., x, xx))
109
Encoding(c(x., x, xx))
110
c(x, xx)
110
c(x, xx)