Go to the documentation of this file.
201 #define ULOC_CHINESE "zh"
203 #define ULOC_ENGLISH "en"
205 #define ULOC_FRENCH "fr"
207 #define ULOC_GERMAN "de"
209 #define ULOC_ITALIAN "it"
211 #define ULOC_JAPANESE "ja"
213 #define ULOC_KOREAN "ko"
215 #define ULOC_SIMPLIFIED_CHINESE "zh_CN"
217 #define ULOC_TRADITIONAL_CHINESE "zh_TW"
220 #define ULOC_CANADA "en_CA"
222 #define ULOC_CANADA_FRENCH "fr_CA"
224 #define ULOC_CHINA "zh_CN"
226 #define ULOC_PRC "zh_CN"
228 #define ULOC_FRANCE "fr_FR"
230 #define ULOC_GERMANY "de_DE"
232 #define ULOC_ITALY "it_IT"
234 #define ULOC_JAPAN "ja_JP"
236 #define ULOC_KOREA "ko_KR"
238 #define ULOC_TAIWAN "zh_TW"
240 #define ULOC_UK "en_GB"
242 #define ULOC_US "en_US"
249 #define ULOC_LANG_CAPACITY 12
256 #define ULOC_COUNTRY_CAPACITY 4
262 #define ULOC_FULLNAME_CAPACITY 157
269 #define ULOC_SCRIPT_CAPACITY 6
275 #define ULOC_KEYWORDS_CAPACITY 96
281 #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
287 #define ULOC_KEYWORD_SEPARATOR '@'
294 #define ULOC_KEYWORD_SEPARATOR_UNICODE 0x40
300 #define ULOC_KEYWORD_ASSIGN '='
307 #define ULOC_KEYWORD_ASSIGN_UNICODE 0x3D
313 #define ULOC_KEYWORD_ITEM_SEPARATOR ';'
320 #define ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B
346 #ifndef U_HIDE_DEPRECATED_API
353 ULOC_DATA_LOCALE_TYPE_LIMIT = 3
356 #ifndef U_HIDE_SYSTEM_API
408 int32_t languageCapacity,
426 int32_t scriptCapacity,
444 int32_t countryCapacity,
462 int32_t variantCapacity,
485 int32_t nameCapacity,
508 int32_t nameCapacity,
561 const char* displayLocale,
563 int32_t languageCapacity,
584 const char* displayLocale,
586 int32_t scriptCapacity,
607 const char* displayLocale,
609 int32_t countryCapacity,
631 const char* displayLocale,
633 int32_t variantCapacity,
678 const char* displayLocale,
680 int32_t destCapacity,
705 const char* displayLocale,
707 int32_t destCapacity,
727 const char* inLocaleID,
729 int32_t maxResultSize,
765 U_STABLE const char*
const* U_EXPORT2
777 U_STABLE const char*
const* U_EXPORT2
796 int32_t parentCapacity,
827 int32_t nameCapacity,
856 const char* keywordName,
857 char* buffer, int32_t bufferCapacity,
885 const char* keywordValue,
886 char* buffer, int32_t bufferCapacity,
889 #ifndef U_HIDE_DRAFT_API
952 ULOC_ACCEPT_FAILED = 0,
953 ULOC_ACCEPT_VALID = 1,
954 ULOC_ACCEPT_FALLBACK = 2
975 const char *httpAcceptLanguage,
995 int32_t acceptListCount,
1052 char* maximizedLocaleID,
1053 int32_t maximizedLocaleIDCapacity,
1092 char* minimizedLocaleID,
1093 int32_t minimizedLocaleIDCapacity,
1122 int32_t localeIDCapacity,
1123 int32_t* parsedLength,
1150 int32_t langtagCapacity,
1154 #ifndef U_HIDE_DRAFT_API
int32_t uloc_getBaseName(const char *localeID, char *name, int32_t nameCapacity, UErrorCode *err)
Gets the full name for the specified locale, like uloc_getName(), but without keywords.
int32_t uloc_getParent(const char *localeID, char *parent, int32_t parentCapacity, UErrorCode *err)
Truncate the locale ID string to get the parent locale ID.
ULayoutType uloc_getCharacterOrientation(const char *localeId, UErrorCode *status)
Get the layout character orientation for the specified locale.
UBool uloc_isRightToLeft(const char *locale)
Returns whether the locale's script is written right-to-left.
int32_t uloc_forLanguageTag(const char *langtag, char *localeID, int32_t localeIDCapacity, int32_t *parsedLength, UErrorCode *err)
Returns a locale ID for the specified BCP47 language tag string.
Basic definitions for ICU, for both C and C++ APIs.
int32_t uloc_getDisplayScript(const char *locale, const char *displayLocale, UChar *script, int32_t scriptCapacity, UErrorCode *status)
Gets the script name suitable for display for the specified locale.
@ ULOC_ACTUAL_LOCALE
This is locale the data actually comes from.
int8_t UBool
The ICU boolean type.
int32_t uloc_acceptLanguage(char *result, int32_t resultAvailable, UAcceptResult *outResult, const char **acceptList, int32_t acceptListCount, UEnumeration *availableLocales, UErrorCode *status)
Based on a list of available locales, determine an acceptable locale for the user.
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested,...
const char *const * uloc_getISOLanguages(void)
Gets a list of all available 2-letter language codes defined in ISO 639, plus additional 3-letter cod...
int32_t uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable, UAcceptResult *outResult, const char *httpAcceptLanguage, UEnumeration *availableLocales, UErrorCode *status)
Based on a HTTP header from a web browser and a list of available locales, determine an acceptable lo...
const char * uloc_toLegacyType(const char *keyword, const char *value)
Converts the specified keyword value (BCP 47 Unicode locale extension type, or legacy type or type al...
ULayoutType
enums for the return value for the character and line orientation functions.
void uloc_setDefault(const char *localeID, UErrorCode *status)
Sets ICU's default locale.
int32_t uloc_getDisplayVariant(const char *locale, const char *displayLocale, UChar *variant, int32_t variantCapacity, UErrorCode *status)
Gets the variant name suitable for display for the specified locale.
int32_t uloc_getScript(const char *localeID, char *script, int32_t scriptCapacity, UErrorCode *err)
Gets the script code for the specified locale.
const char *const * uloc_getISOCountries(void)
Gets a list of all available 2-letter country codes defined in ISO 639.
int32_t uloc_minimizeSubtags(const char *localeID, char *minimizedLocaleID, int32_t minimizedLocaleIDCapacity, UErrorCode *err)
Minimize the subtags for a provided locale ID, per the algorithm described in the following CLDR tech...
int32_t uloc_getName(const char *localeID, char *name, int32_t nameCapacity, UErrorCode *err)
Gets the full name for the specified locale.
const char * uloc_getISO3Language(const char *localeID)
Gets the ISO language code for the specified locale.
const char * uloc_getDefault(void)
Gets ICU's default locale.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
int32_t uloc_getKeywordValue(const char *localeID, const char *keywordName, char *buffer, int32_t bufferCapacity, UErrorCode *status)
Get the value for a keyword.
UEnumeration * uloc_openKeywords(const char *localeID, UErrorCode *status)
Gets an enumeration of keywords for the specified locale.
const char * uloc_getAvailable(int32_t n)
Gets the specified locale from a list of all available locales.
int32_t uloc_getDisplayLanguage(const char *locale, const char *displayLocale, UChar *language, int32_t languageCapacity, UErrorCode *status)
Gets the language name suitable for display for the specified locale.
int32_t uloc_getCountry(const char *localeID, char *country, int32_t countryCapacity, UErrorCode *err)
Gets the country code for the specified locale.
@ ULOC_VALID_LOCALE
This is the most specific locale supported by ICU.
int32_t uloc_toLanguageTag(const char *localeID, char *langtag, int32_t langtagCapacity, UBool strict, UErrorCode *err)
Returns a well-formed language tag for this locale ID.
int32_t uloc_addLikelySubtags(const char *localeID, char *maximizedLocaleID, int32_t maximizedLocaleIDCapacity, UErrorCode *err)
Add the likely subtags for a provided locale ID, per the algorithm described in the following CLDR te...
int32_t uloc_getDisplayName(const char *localeID, const char *inLocaleID, UChar *result, int32_t maxResultSize, UErrorCode *err)
Gets the full name suitable for display for the specified locale.
int32_t uloc_getLanguage(const char *localeID, char *language, int32_t languageCapacity, UErrorCode *err)
Gets the language code for the specified locale.
int32_t uloc_countAvailable(void)
Gets the size of the all available locale list.
int32_t uloc_getVariant(const char *localeID, char *variant, int32_t variantCapacity, UErrorCode *err)
Gets the variant code for the specified locale.
int32_t uloc_setKeywordValue(const char *keywordName, const char *keywordValue, char *buffer, int32_t bufferCapacity, UErrorCode *status)
Sets or removes the value of the specified keyword.
#define U_DRAFT
This is used to declare a function as a draft public ICU C API
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
const char * uloc_getISO3Country(const char *localeID)
Gets the ISO country code for the specified locale.
const char * uloc_toUnicodeLocaleKey(const char *keyword)
Converts the specified keyword (legacy key, or BCP 47 Unicode locale extension key) to the equivalent...
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
uint32_t uloc_getLCID(const char *localeID)
Gets the Win32 LCID value for the specified locale.
ULayoutType uloc_getLineOrientation(const char *localeId, UErrorCode *status)
Get the layout line orientation for the specified locale.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
int32_t uloc_getDisplayKeywordValue(const char *locale, const char *keyword, const char *displayLocale, UChar *dest, int32_t destCapacity, UErrorCode *status)
Gets the value of the keyword suitable for display for the specified locale.
int32_t uloc_getDisplayKeyword(const char *keyword, const char *displayLocale, UChar *dest, int32_t destCapacity, UErrorCode *status)
Gets the keyword name suitable for display for the specified locale.
int32_t uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity, UErrorCode *status)
Gets the ICU locale ID for the specified Win32 LCID value.
@ ULOC_REQUESTED_LOCALE
This is the requested locale.
const char * uloc_toLegacyKey(const char *keyword)
Converts the specified keyword (BCP 47 Unicode locale extension key, or legacy key) to the legacy key...
int32_t uloc_canonicalize(const char *localeID, char *name, int32_t nameCapacity, UErrorCode *err)
Gets the full name for the specified locale.
UAcceptResult
enums for the 'outResult' parameter return value
C API: String Enumeration.
const char * uloc_toUnicodeLocaleType(const char *keyword, const char *value)
Converts the specified keyword value (legacy type, or BCP 47 Unicode locale extension type) to the we...
int32_t uloc_getDisplayCountry(const char *locale, const char *displayLocale, UChar *country, int32_t countryCapacity, UErrorCode *status)
Gets the country name suitable for display for the specified locale.