| localeToCharset {utils} | R Documentation |
This functions aims to find a suitable coding for the locale named, by default the current locale, and if it is a UTF-8 locale a suitable single-byte encoding.
localeToCharset(locale = Sys.getlocale("LC_CTYPE"))
locale |
character string naming a locale. |
The operation differs by OS.
A Windows locale is specified like "English_United Kingdom.1252".
The final component gives the codepage, and this defines the encoding.
In the C locale the answer will be "ASCII".
A character vector naming an encoding and possibly a fallback
single-encoding, NA if unknown.
The encoding names are those used by libiconv, and ought also
to work with glibc but maybe not with commercial Unixen.
localeToCharset()