Read or write files, assuming they are encoded in UTF-8. read_utf8() is
roughly readLines(encoding = 'UTF-8') (a warning will be issued if non-UTF8
lines are found), and write_utf8() calls writeLines(enc2utf8(text), useBytes = TRUE).
Arguments
- con
A connection or a file path.
- error
Whether to signal an error when non-UTF8 characters are detected (if
FALSE, only a warning message is issued).- text
A character vector (will be converted to UTF-8 via
enc2utf8()).- ...
Other arguments passed to
writeLines()(exceptuseBytes, which isTRUEinwrite_utf8()).- sort
Logical (
FALSEmeans not to sort the content) or a function to sort the content;TRUEis equivalent tobase::sort.