library/roles/R/templates/Rprofile.site.j2: Set the R locale inherithing the system one. See https://support.d4science.org/issues/12227

This commit is contained in:
Andrea Dell'Amico 2018-09-04 17:32:14 +02:00
parent 71d08bafe7
commit 5a6206d79d
1 changed files with 11 additions and 2 deletions

View File

@ -11,3 +11,12 @@ local({r <- getOption("repos")
r["CRAN"] <- "{{ r_cran_mirror_site }}" r["CRAN"] <- "{{ r_cran_mirror_site }}"
options(repos=r) options(repos=r)
}) })
# Explicitly set the R encoding using the system one, if it exists
if (file.exists("/etc/default/locale")) {
readRenviron("/etc/default/locale")
LANG <- Sys.getenv("LANG")
if(nchar(LANG))
Sys.setlocale("LC_ALL", LANG)
}