Expand description
The LocaleString
type provides the a structure for locale identifier strings.
§Standards
On POSIX platforms such as Unix, Linux and others, locale identifiers are defined by ISO/IEC 15897, which is similar to the BCP 47 definition of language tags, but the locale variant modifier is defined differently, and the character set is included as a part of the identifier.
Locale identifiers are defined in this format: [language[_territory][.codeset][@modifier]]
.
For example, Australian English using the UTF-8 encoding is en_AU.UTF-8
.
language
= ISO 639-1 2-character language codes.territory
= ISO 3166-1 2-character country codes.codeset
= an undefined string value,[a-zA-Z0-9_\-]+
.- For example, IEC 8859 parts 1 to 16 are
usually specified as
ISO8859-1
and so on. - should be taken from the values in the IANA character sets list.
- For example, IEC 8859 parts 1 to 16 are
usually specified as
modifier
= a semi-colon separated list of identifiers, or name ‘=’ value pairs.- Sometimes this is used to indicate the language script in use, as such values from ISO 15924 should be used.
See also:
- Wikipedia Locale
- GNU C Library - Locale-Names
- Apple - NSLocale and localeIdentifier
- Microsoft C Runtime - Locale names, Languages, and Country/Region strings
- Microsoft Windows - Locale Names
- IETF Tags for Identifying Languages
- W3C Language Tags and Locale Identifiers for the World Wide Web
- ISO Procedures for the registration of cultural elements
Structs§
- Locale
String - A
LocaleString
is a representation of the POSIX notion of a Locale identifier, used in operating system calls and environment variables. It implements theLocaleIdentifier
trait.
Enums§
- Parse
Error - Errors possibly returned from
from_str()
.