I have the same issue with RStudio 2022.02.3+492 and R 4.2.0 on Windows 10. Interestingly, RStudio sets the locale to C
, while both RGui and R.exe sets the proper locale. I can solve the issue in RStudio by running Sys.setlocale(locale='no_NB.utf8')
or Sys.setlocale(locale = 'Norwegian Bokmål_Norway')
. This can also be added to ~/.Rprofile
for a more permanent fix. Below is the result from sessionInfo()
from R.exe and RStudio:
R.exe:
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=Norwegian Bokmål_Norway.utf8
[2] LC_CTYPE=Norwegian Bokmål_Norway.utf8
[3] LC_MONETARY=Norwegian Bokmål_Norway.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=Norwegian Bokmål_Norway.utf8
RStudio:
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] C