Hi,
I'm currently working on a tutorial package that uses learnr to create the tutorials.
However, whenever the tutorials are rendered, they use the default encoding for the system despite the files being saved in UTF-8 following the process described here: Shiny - Unicode characters in Shiny apps.
This obviously leads to problems like the one shown below.
Currently, when I reinstall the package and build the tutorial again, the tutorial's HTML file has the encoding error built in despite the overall HTML file using the UTF-8 charset. When I inspect the element with the encoding error, the HTML code looks like this:
<p>The Terminal tab will have a dollar sign (<code>$</code>) as the prompt. If it doesn’t have that and instead uses an arrow (<code>></code>), you may have to check your global options.</p>
This does not appear when I render the tutorial using the rmarkdown::render()
command, lending me to believe that there's a problem with the way that I set up learnr's rendering system.
Is there a way that I can force learnr to use the UTF-8 encoding?
I've attached my session info below.
Thank you!
sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19043)
#>
#> Matrix products: default
#>
#> locale:
#> [1] LC_COLLATE=English_United States.1252
#> [2] LC_CTYPE=English_United States.1252
#> [3] LC_MONETARY=English_United States.1252
#> [4] LC_NUMERIC=C
#> [5] LC_TIME=English_United States.1252
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] ps_1.6.0 digest_0.6.27 withr_2.4.2 magrittr_2.0.1
#> [5] reprex_2.0.0 evaluate_0.14 highr_0.9 stringi_1.6.2
#> [9] rlang_0.4.11 cli_2.5.0 rstudioapi_0.13 fs_1.5.0
#> [13] rmarkdown_2.8 tools_4.1.0 stringr_1.4.0 glue_1.4.2
#> [17] xfun_0.23 yaml_2.2.1 compiler_4.1.0 htmltools_0.5.1.1
#> [21] knitr_1.33
Created on 2021-07-06 by the reprex package (v2.0.0)