I there a way to change the console encoding in Rstudio on windows?
This is not about reading files or sourcing scripts in a specific encoding but about changing the console encoding (the encoding Sys.getlocale yields).
This is usually not a big problem, but i try to create a package and I'm using german umlauts in some strings and symbols. roxygen2
works best with UTF-8
encoding but covr
gives an error if the source files are not in the console/system encoding.
(If there's a workaround for the roxygen2
and covr
problem this would also help. Addintional info: I call covr::package_coverage
from the console and I call roxygen2
via Rstudios Build command.)
and sessioninfo:
sessionInfo()
# R version 3.4.2 (2017-09-28)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows >= 8 x64 (build 9200)
#
# Matrix products: default
#
# locale:
# [1] LC_COLLATE=German_Austria.1252 LC_CTYPE=German_Austria.1252 LC_MONETARY=German_Austria.1252 LC_NUMERIC=C LC_TIME=German_Austria.1252
Update: Sourcing the function that gives an error through the file in Rstudio works, loading with devtools::load_all(".")
and the RStudio gui gives the error/wrong encoding.