A character vector naming an encoding and possibly a fallback
single-encoding, NA if unknown.
The operation differs by OS.
a locale is specified like "English_United Kingdom.1252".
The final component gives the codepage, and this defines the encoding.
Locale names are normally like es_MX.iso88591. If final
component indicates an encoding and it is not utf8 we just need
to look up the equivalent encoding name. Otherwise, the language
(here es) is used to choose a primary or fallback encoding.