R/enc.R

Defines functions read_lines_enc

read_lines_enc <- function(
  path,
  file_encoding = "UTF-8",
  n = -1L,
  ok = TRUE,
  skipNul = FALSE
) {
  con <- file(path, encoding = file_encoding)
  defer(close(con))

  lines <- readLines(con, warn = FALSE, n = n, ok = ok, skipNul = skipNul)
  Encoding(lines) <- "UTF-8"
  lines
}

Try the pkgload package in your browser

Any scripts or data that you put into this service are public.

pkgload documentation built on Nov. 5, 2025, 5:18 p.m.