Get details of or set aspects of the locale for the R process.
Sys.getlocale(category = "LC_ALL")
Sys.setlocale(category = "LC_ALL", locale = "")
| Parameter | Description |
|---|---|
category |
character string. The following categories should always be supported: "LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC" and "LC_TIME". Some systems (not Windows) will also support "LC_MESSAGES", "LC_PAPER" and "LC_MEASUREMENT". |
locale |
character string. A valid locale name on the system in use. Normally "" (the default) will pick up the default locale for the system. |
# NOT RUN {
Sys.getlocale()
Sys.getlocale("LC_TIME")
# }
# NOT RUN {
Sys.setlocale("LC_TIME", "de") # Solaris: details are OS-dependent
Sys.setlocale("LC_TIME", "de_DE") # Many Unix-alikes
Sys.setlocale("LC_TIME", "de_DE.UTF-8") # Linux, macOS, other Unix-alikes
Sys.setlocale("LC_TIME", "de_DE.utf8") # some Linux versions
Sys.setlocale("LC_TIME", "German") # Windows
# }
# NOT RUN {
Sys.getlocale("LC_PAPER") # may or may not be set
# }
# NOT RUN {
Sys.setlocale("LC_COLLATE", "C") # turn off locale-specific sorting,
# usually (but not on all platforms)
# }