system3 | R Documentation |
system2()
and mark its character output as UTF-8 if appropriateThis is a wrapper function based on system2()
. If system2()
returns character output (e.g., with the argument stdout = TRUE
),
check if the output is encoded in UTF-8. If it is, mark it with UTF-8
explicitly.
system3(...)
... |
Passed to |
The value returned by system2()
.
a = shQuote(c("-e", "print(intToUtf8(c(20320, 22909)))"))
x2 = system2("Rscript", a, stdout = TRUE)
Encoding(x2) # unknown
x3 = xfun::system3("Rscript", a, stdout = TRUE)
# encoding of x3 should be UTF-8 if the current locale is UTF-8
!l10n_info()[["UTF-8"]] || Encoding(x3) == "UTF-8" # should be TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.