From af999b4127e9e47911937aea5b9c27da5749a3ec Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Tue, 27 Nov 2018 13:56:19 -0600 Subject: [PATCH] use xfun::read/write_utf8() instead --- R/rsos_article.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/rsos_article.R b/R/rsos_article.R index 1acf3092d..af7a847d6 100644 --- a/R/rsos_article.R +++ b/R/rsos_article.R @@ -69,7 +69,7 @@ rsos_article <- function( post_processor <- function( metadata, input_file, output_file, clean, verbose ) { - text <- readLines(output_file, warn = FALSE) + text <- xfun::read_utf8(output_file) # set correct text in fmtext environment end_first_page <- grep("^\\\\EndFirstPage", text) #nolint @@ -84,7 +84,7 @@ rsos_article <- function( text[(end_first_page + 1):length(text)] ) } - writeLines(enc2utf8(text), output_file, useBytes = TRUE) + xfun::write_utf8(text, output_file) output_file }