Skip to content

Commit e016ef9

Browse files
committed
work around a crash in RStudio on Windows UCRT (#296)
1 parent 838f19e commit e016ef9

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

R/jinit.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
## unfortunately Sys/setlocale()/Sys.getlocale() have incompatible interfaces so there
5252
## is no good way to get/set locales -- so we have to hack around it ...
5353
locale.list <- c("LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", "LC_PAPER", "LC_MEASUREMENT")
54+
## RStudio on Windows crashes due to missing error handlers if locales
55+
## are queried that Windows does not support so we remove those to work around it
56+
if (identical(.Platform$OS.type, "windows"))
57+
locale.list <- locale.list[-(6:8)]
5458
locales <- sapply(locale.list, Sys.getlocale)
5559
loc.sig <- Sys.getlocale()
5660

0 commit comments

Comments
 (0)