Skip to content

Commit 697d4b5

Browse files
adapt from xfun due to a failing build on R 3.6 on Windows (https://github.com/r-lib/styler/pull/685/checks?check_run_id=1338739147)
1 parent e59073a commit 697d4b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/io.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ read_utf8 <- function(path) {
9696
#' @keywords internal
9797
#' @importFrom utils head
9898
read_utf8_bare <- function(con, warn = TRUE) {
99+
opts <- options(encoding = "native.enc")
100+
on.exit(options(opts), add = TRUE)
99101
x <- readLines(con, encoding = "UTF-8", warn = warn)
100102
i <- invalid_utf8(x)
101103
n <- length(i)

0 commit comments

Comments
 (0)