Stata 15 help for set locale_functions

[P] set locale_functions -- Specify default locale for functions

Syntax

Use the system locale for Unicode functions

set locale_functions default [, permanently]

Specify a locale for Unicode functions

set locale_functions locale [, permanently]

Description

set locale_functions sets the locale to be used by functions that take locale as an optional argument: ustrupper(), ustrlower(), ustrtitle(), ustrword(), ustrwordcount(), ustrcompare(), and ustrsortkey() and their Mata equivalents. When the argument is not specified, the locale_functions setting is used. If locale_functions is not set, the default ICU locale is used.

For example, if your operating system is Microsoft Windows English version, the system locale may be "en". If you chose the specific country to be the United States during installation of your OS, then the system locale is most likely "en_US". If locale_functions is not set or is set to default, then calling ustrupper("istanbul") is equivalent to calling ustrupper("istanbul", "en_US"), which returns ISTANBUL. However, if locale_functions is set to "tr" for Turkish, then calling ustrupper("istanbul") is equivalent to calling ustrupper("istanbul", "tr"), which returns ─░STANBUL. For further discussion of locales, see [U] 12.4.2.4 Locales in Unicode.

Note that although ICU does not validate locales, Stata validates the language subtag of the locale_functions setting. It must be a valid ISO-639-2 language code. See the ISO-639-2 list at http://www.loc.gov/standards/iso639-2/.

The current locale_functions setting is stored in c(locale_functions). c(locale_functions) is reset to its original value when a program or do-file exits.

Option

permanently specifies that, in addition to making the change right now, the setting be remembered and become the default setting when you invoke Stata.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index