R script code not visible

I just replaced an older version of RStudio with RStudio-2022.02.2-485. R code is now not visible in the IDE when opening .R script. Rereading the file using (non-default) UTF-8 encoding solves the problem, but this still seems strange. This appears to be similar to an older closed issue mentioned here: Latest RStudio not showing R scripts and deleteing files... - #4 by grosscol.

1 Like

I have the very same problem! Only the blank script is shown after the installation of the newest version of R + RStudio, although the file is definitely not empty (it has non-zero size and it is openable in e.g. Notepad).

In the most recent (2022.02.2 Build 485) RStudio pulldowns have you tried File -> Reopen with Encoding...-> UTF-8 encoding?

1 Like

Yes, I've tried this and it kinda helps, but then I lose all characters with diacritics in my notes (# blahblah) so it's no longer meaningful or readable...

This solution worked for me. Thanks a lot.

I think you're seeing this issue: R 4.2: Document unexpectedly opens as empty in some cases · Issue #11206 · rstudio/rstudio · GitHub

We have a fix in our daily builds if you're willing to try:


Opening of code docs appears to work now in default ISO-8859-1 for RStudio
2022.06.0 Build 412.