Character encoding issue when previewing Notebook

When I preview an R Notebook the default way, I get this:

If I instead "knit as HTML", it comes out fine.
It looks like a character encoding issue to me, but how do I fix it?


Can you provide the output of utils::sessionInfo()?

After previewing (and getting the same result):

> utils::sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.3 LTS

Matrix products: default
BLAS: /usr/lib/libblas/
LAPACK: /usr/lib/lapack/

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14       magrittr_1.5       knitr_1.18         splines_3.4.2      MASS_7.3-48       
 [6] munsell_0.4.3      colorspace_1.3-2   lattice_0.20-35    rlang_0.2.0        minqa_1.2.4       
[11] stringr_1.3.0      plyr_1.8.4         tools_3.4.2        grid_3.4.2         gtable_0.2.0      
[16] nlme_3.1-131       htmltools_0.3.6    yaml_2.1.16        lme4_1.1-15        lazyeval_0.2.1    
[21] digest_0.6.14      rprojroot_1.3-1    tibble_1.4.2       Matrix_1.2-12      nloptr_1.0.4      
[26] ggplot2_2.2.1.9000 base64enc_0.1-3    evaluate_0.10.1    rmarkdown_1.8      stringi_1.1.6     
[31] compiler_3.4.2     pillar_1.1.0       scales_0.5.0.9000  backports_1.1.2    jsonlite_1.5      

Thanks! I've reproduced this on my Ubuntu VM and have filed an issue here:

1 Like

thank you! (not the most important thing in the world, but kind
of mysterious.)

Hi, Kevin,

I read the issue and am I correct in thinking this won't be fixed until RStudio 1.3 is released? I was a bit unclear on the conclusion to the issue.

I'm using notebooks in a workshop and several windows learners get this problem. We'll switch to using regular rmarkdown if it's still unresolved for now, but I just wanted to check there wasn't a simple fix.



Right, this unfortunately won't be fixed in v1.2. We're hoping to get a preview release of v1.3 ready in the not-so-distant future, so hopefully you won't have to live too long without this issue fixed.


Great, thanks Kevin.