00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ULOC_H
00024 #define ULOC_H
00025
00026 #include "unicode/utypes.h"
00027 #include "unicode/uenum.h"
00028
00203 #define ULOC_CHINESE "zh"
00204
00205 #define ULOC_ENGLISH "en"
00206
00207 #define ULOC_FRENCH "fr"
00208
00209 #define ULOC_GERMAN "de"
00210
00211 #define ULOC_ITALIAN "it"
00212
00213 #define ULOC_JAPANESE "ja"
00214
00215 #define ULOC_KOREAN "ko"
00216
00217 #define ULOC_SIMPLIFIED_CHINESE "zh_CN"
00218
00219 #define ULOC_TRADITIONAL_CHINESE "zh_TW"
00220
00222 #define ULOC_CANADA "en_CA"
00223
00224 #define ULOC_CANADA_FRENCH "fr_CA"
00225
00226 #define ULOC_CHINA "zh_CN"
00227
00228 #define ULOC_PRC "zh_CN"
00229
00230 #define ULOC_FRANCE "fr_FR"
00231
00232 #define ULOC_GERMANY "de_DE"
00233
00234 #define ULOC_ITALY "it_IT"
00235
00236 #define ULOC_JAPAN "ja_JP"
00237
00238 #define ULOC_KOREA "ko_KR"
00239
00240 #define ULOC_TAIWAN "zh_TW"
00241
00242 #define ULOC_UK "en_GB"
00243
00244 #define ULOC_US "en_US"
00245
00251 #define ULOC_LANG_CAPACITY 12
00252
00258 #define ULOC_COUNTRY_CAPACITY 4
00259
00264 #define ULOC_FULLNAME_CAPACITY 157
00265
00271 #define ULOC_SCRIPT_CAPACITY 6
00272
00277 #define ULOC_KEYWORDS_CAPACITY 96
00278
00283 #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
00284
00289 #define ULOC_KEYWORD_SEPARATOR '@'
00290
00296 #define ULOC_KEYWORD_SEPARATOR_UNICODE 0x40
00297
00302 #define ULOC_KEYWORD_ASSIGN '='
00303
00309 #define ULOC_KEYWORD_ASSIGN_UNICODE 0x3D
00310
00315 #define ULOC_KEYWORD_ITEM_SEPARATOR ';'
00316
00322 #define ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B
00323
00338 typedef enum {
00342 ULOC_ACTUAL_LOCALE = 0,
00346 ULOC_VALID_LOCALE = 1,
00347
00348 #ifndef U_HIDE_DEPRECATED_API
00349
00352 ULOC_REQUESTED_LOCALE = 2,
00353
00358 ULOC_DATA_LOCALE_TYPE_LIMIT = 3
00359 #endif // U_HIDE_DEPRECATED_API
00360 } ULocDataLocaleType;
00361
00362 #ifndef U_HIDE_SYSTEM_API
00363
00374 U_STABLE const char* U_EXPORT2
00375 uloc_getDefault(void);
00376
00394 U_STABLE void U_EXPORT2
00395 uloc_setDefault(const char* localeID,
00396 UErrorCode* status);
00397 #endif
00398
00411 U_STABLE int32_t U_EXPORT2
00412 uloc_getLanguage(const char* localeID,
00413 char* language,
00414 int32_t languageCapacity,
00415 UErrorCode* err);
00416
00429 U_STABLE int32_t U_EXPORT2
00430 uloc_getScript(const char* localeID,
00431 char* script,
00432 int32_t scriptCapacity,
00433 UErrorCode* err);
00434
00447 U_STABLE int32_t U_EXPORT2
00448 uloc_getCountry(const char* localeID,
00449 char* country,
00450 int32_t countryCapacity,
00451 UErrorCode* err);
00452
00465 U_STABLE int32_t U_EXPORT2
00466 uloc_getVariant(const char* localeID,
00467 char* variant,
00468 int32_t variantCapacity,
00469 UErrorCode* err);
00470
00471
00488 U_STABLE int32_t U_EXPORT2
00489 uloc_getName(const char* localeID,
00490 char* name,
00491 int32_t nameCapacity,
00492 UErrorCode* err);
00493
00511 U_STABLE int32_t U_EXPORT2
00512 uloc_canonicalize(const char* localeID,
00513 char* name,
00514 int32_t nameCapacity,
00515 UErrorCode* err);
00516
00524 U_STABLE const char* U_EXPORT2
00525 uloc_getISO3Language(const char* localeID);
00526
00527
00535 U_STABLE const char* U_EXPORT2
00536 uloc_getISO3Country(const char* localeID);
00537
00549 U_STABLE uint32_t U_EXPORT2
00550 uloc_getLCID(const char* localeID);
00551
00568 U_STABLE int32_t U_EXPORT2
00569 uloc_getDisplayLanguage(const char* locale,
00570 const char* displayLocale,
00571 UChar* language,
00572 int32_t languageCapacity,
00573 UErrorCode* status);
00574
00591 U_STABLE int32_t U_EXPORT2
00592 uloc_getDisplayScript(const char* locale,
00593 const char* displayLocale,
00594 UChar* script,
00595 int32_t scriptCapacity,
00596 UErrorCode* status);
00597
00616 U_STABLE int32_t U_EXPORT2
00617 uloc_getDisplayCountry(const char* locale,
00618 const char* displayLocale,
00619 UChar* country,
00620 int32_t countryCapacity,
00621 UErrorCode* status);
00622
00623
00640 U_STABLE int32_t U_EXPORT2
00641 uloc_getDisplayVariant(const char* locale,
00642 const char* displayLocale,
00643 UChar* variant,
00644 int32_t variantCapacity,
00645 UErrorCode* status);
00646
00687 U_STABLE int32_t U_EXPORT2
00688 uloc_getDisplayKeyword(const char* keyword,
00689 const char* displayLocale,
00690 UChar* dest,
00691 int32_t destCapacity,
00692 UErrorCode* status);
00713 U_STABLE int32_t U_EXPORT2
00714 uloc_getDisplayKeywordValue( const char* locale,
00715 const char* keyword,
00716 const char* displayLocale,
00717 UChar* dest,
00718 int32_t destCapacity,
00719 UErrorCode* status);
00736 U_STABLE int32_t U_EXPORT2
00737 uloc_getDisplayName(const char* localeID,
00738 const char* inLocaleID,
00739 UChar* result,
00740 int32_t maxResultSize,
00741 UErrorCode* err);
00742
00743
00760 U_STABLE const char* U_EXPORT2
00761 uloc_getAvailable(int32_t n);
00762
00769 U_STABLE int32_t U_EXPORT2 uloc_countAvailable(void);
00770
00771 #ifndef U_HIDE_DRAFT_API
00772
00778 typedef enum ULocAvailableType {
00785 ULOC_AVAILABLE_DEFAULT,
00786
00803 ULOC_AVAILABLE_ONLY_LEGACY_ALIASES,
00804
00811 ULOC_AVAILABLE_WITH_LEGACY_ALIASES,
00812
00813 #ifndef U_HIDE_INTERNAL_API
00814
00817 ULOC_AVAILABLE_COUNT
00818 #endif
00819 } ULocAvailableType;
00820
00832 U_DRAFT UEnumeration* U_EXPORT2
00833 uloc_openAvailableByType(ULocAvailableType type, UErrorCode* status);
00834
00835 #endif // U_HIDE_DRAFT_API
00836
00848 U_STABLE const char* const* U_EXPORT2
00849 uloc_getISOLanguages(void);
00850
00860 U_STABLE const char* const* U_EXPORT2
00861 uloc_getISOCountries(void);
00862
00876 U_STABLE int32_t U_EXPORT2
00877 uloc_getParent(const char* localeID,
00878 char* parent,
00879 int32_t parentCapacity,
00880 UErrorCode* err);
00881
00882
00883
00884
00907 U_STABLE int32_t U_EXPORT2
00908 uloc_getBaseName(const char* localeID,
00909 char* name,
00910 int32_t nameCapacity,
00911 UErrorCode* err);
00912
00922 U_STABLE UEnumeration* U_EXPORT2
00923 uloc_openKeywords(const char* localeID,
00924 UErrorCode* status);
00925
00939 U_STABLE int32_t U_EXPORT2
00940 uloc_getKeywordValue(const char* localeID,
00941 const char* keywordName,
00942 char* buffer, int32_t bufferCapacity,
00943 UErrorCode* status);
00944
00945
00976 U_STABLE int32_t U_EXPORT2
00977 uloc_setKeywordValue(const char* keywordName,
00978 const char* keywordValue,
00979 char* buffer, int32_t bufferCapacity,
00980 UErrorCode* status);
00981
00996 U_STABLE UBool U_EXPORT2
00997 uloc_isRightToLeft(const char *locale);
00998
01004 typedef enum {
01005 ULOC_LAYOUT_LTR = 0,
01006 ULOC_LAYOUT_RTL = 1,
01007 ULOC_LAYOUT_TTB = 2,
01008 ULOC_LAYOUT_BTT = 3,
01009 ULOC_LAYOUT_UNKNOWN
01010 } ULayoutType;
01011
01020 U_STABLE ULayoutType U_EXPORT2
01021 uloc_getCharacterOrientation(const char* localeId,
01022 UErrorCode *status);
01023
01032 U_STABLE ULayoutType U_EXPORT2
01033 uloc_getLineOrientation(const char* localeId,
01034 UErrorCode *status);
01035
01042 typedef enum {
01043 ULOC_ACCEPT_FAILED = 0,
01044 ULOC_ACCEPT_VALID = 1,
01045 ULOC_ACCEPT_FALLBACK = 2
01046
01047
01048 } UAcceptResult;
01049
01050
01063 U_STABLE int32_t U_EXPORT2
01064 uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
01065 UAcceptResult *outResult,
01066 const char *httpAcceptLanguage,
01067 UEnumeration* availableLocales,
01068 UErrorCode *status);
01069
01083 U_STABLE int32_t U_EXPORT2
01084 uloc_acceptLanguage(char *result, int32_t resultAvailable,
01085 UAcceptResult *outResult, const char **acceptList,
01086 int32_t acceptListCount,
01087 UEnumeration* availableLocales,
01088 UErrorCode *status);
01089
01090
01103 U_STABLE int32_t U_EXPORT2
01104 uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity,
01105 UErrorCode *status);
01106
01107
01141 U_STABLE int32_t U_EXPORT2
01142 uloc_addLikelySubtags(const char* localeID,
01143 char* maximizedLocaleID,
01144 int32_t maximizedLocaleIDCapacity,
01145 UErrorCode* err);
01146
01147
01181 U_STABLE int32_t U_EXPORT2
01182 uloc_minimizeSubtags(const char* localeID,
01183 char* minimizedLocaleID,
01184 int32_t minimizedLocaleIDCapacity,
01185 UErrorCode* err);
01186
01210 U_STABLE int32_t U_EXPORT2
01211 uloc_forLanguageTag(const char* langtag,
01212 char* localeID,
01213 int32_t localeIDCapacity,
01214 int32_t* parsedLength,
01215 UErrorCode* err);
01216
01238 U_STABLE int32_t U_EXPORT2
01239 uloc_toLanguageTag(const char* localeID,
01240 char* langtag,
01241 int32_t langtagCapacity,
01242 UBool strict,
01243 UErrorCode* err);
01244
01266 U_STABLE const char* U_EXPORT2
01267 uloc_toUnicodeLocaleKey(const char* keyword);
01268
01297 U_STABLE const char* U_EXPORT2
01298 uloc_toUnicodeLocaleType(const char* keyword, const char* value);
01299
01312 U_STABLE const char* U_EXPORT2
01313 uloc_toLegacyKey(const char* keyword);
01314
01341 U_STABLE const char* U_EXPORT2
01342 uloc_toLegacyType(const char* keyword, const char* value);
01343
01344 #endif