File: read_utf8.Rd

package info (click to toggle)
r-cran-xfun 0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680 kB
  • sloc: ansic: 242; sh: 22; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/io.R
\name{read_utf8}
\alias{read_utf8}
\alias{write_utf8}
\title{Read / write files encoded in UTF-8}
\usage{
read_utf8(con, error = FALSE)

write_utf8(text, con, ...)
}
\arguments{
\item{con}{A connection or a file path.}

\item{error}{Whether to signal an error when non-UTF8 characters are detected
(if \code{FALSE}, only a warning message is issued).}

\item{text}{A character vector (will be converted to UTF-8 via
\code{\link{enc2utf8}()}).}

\item{...}{Other arguments passed to \code{\link{writeLines}()} (except
\code{useBytes}, which is \code{TRUE} in \code{write_utf8()}).}
}
\description{
Read or write files, assuming they are encoded in UTF-8. \code{read_utf8()}
is roughly \code{readLines(encoding = 'UTF-8')} (a warning will be issued if
non-UTF8 lines are found), and \code{write_utf8()} calls
\code{writeLines(enc2utf8(text), useBytes = TRUE)}.
}