| Line 25... |
Line 25... |
| 25 |
\item{x}{A character vector.}
|
25 |
\item{x}{A character vector.}
|
| 26 |
\item{value}{A character vector of positive length.}
|
26 |
\item{value}{A character vector of positive length.}
|
| 27 |
}
|
27 |
}
|
| 28 |
\details{
|
28 |
\details{
|
| 29 |
Character strings in \R can be declared to be in \code{"latin1"} or
|
29 |
Character strings in \R can be declared to be in \code{"latin1"} or
|
| 30 |
\code{"UTF-8"}. These declarations can be read by \code{Encoding},
|
30 |
\code{"UTF-8"} or \code{"bytes"}. These declarations can be read by
|
| 31 |
which will return a character vector of values \code{"latin1"},
|
31 |
\code{Encoding}, which will return a character vector of values
|
| 32 |
\code{"UTF-8"} or \code{"unknown"}, or set, when \code{value} is
|
32 |
\code{"latin1"}, \code{"UTF-8"} \code{"bytes"} or \code{"unknown"}, or
|
| 33 |
recycled as needed and other values are silently treated as
|
33 |
set, when \code{value} is recycled as needed and other values are
|
| 34 |
\code{"unknown"}. ASCII strings will never be marked with a declared
|
34 |
silently treated as \code{"unknown"}. ASCII strings will never be
|
| 35 |
encoding, since their representation is the same in all supported encodings.
|
35 |
marked with a declared encoding, since their representation is the
|
| - |
|
36 |
same in all supported encodings. Strings marked as \code{"bytes"} are
|
| - |
|
37 |
intended to be non-ASCII strings which should be manipulated as bytes,
|
| - |
|
38 |
and never converted to a character encoding.
|
| 36 |
|
39 |
|
| 37 |
\code{enc2native} and \code{enc2utf8} convert elements of character
|
40 |
\code{enc2native} and \code{enc2utf8} convert elements of character
|
| 38 |
vectors to the native encoding or UTF-8 respectively, taking any
|
41 |
vectors to the native encoding or UTF-8 respectively, taking any
|
| 39 |
marked encoding into account. They are \link{primitive} functions,
|
42 |
marked encoding into account. They are \link{primitive} functions,
|
| 40 |
designed to do minimal copying.
|
43 |
designed to do minimal copying.
|