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
00754 U_STABLE const char* U_EXPORT2
00755 uloc_getAvailable(int32_t n);
00756
00763 U_STABLE int32_t U_EXPORT2 uloc_countAvailable(void);
00764
00776 U_STABLE const char* const* U_EXPORT2
00777 uloc_getISOLanguages(void);
00778
00788 U_STABLE const char* const* U_EXPORT2
00789 uloc_getISOCountries(void);
00790
00804 U_STABLE int32_t U_EXPORT2
00805 uloc_getParent(const char* localeID,
00806 char* parent,
00807 int32_t parentCapacity,
00808 UErrorCode* err);
00809
00810
00811
00812
00835 U_STABLE int32_t U_EXPORT2
00836 uloc_getBaseName(const char* localeID,
00837 char* name,
00838 int32_t nameCapacity,
00839 UErrorCode* err);
00840
00850 U_STABLE UEnumeration* U_EXPORT2
00851 uloc_openKeywords(const char* localeID,
00852 UErrorCode* status);
00853
00867 U_STABLE int32_t U_EXPORT2
00868 uloc_getKeywordValue(const char* localeID,
00869 const char* keywordName,
00870 char* buffer, int32_t bufferCapacity,
00871 UErrorCode* status);
00872
00873
00904 U_STABLE int32_t U_EXPORT2
00905 uloc_setKeywordValue(const char* keywordName,
00906 const char* keywordValue,
00907 char* buffer, int32_t bufferCapacity,
00908 UErrorCode* status);
00909
00924 U_STABLE UBool U_EXPORT2
00925 uloc_isRightToLeft(const char *locale);
00926
00932 typedef enum {
00933 ULOC_LAYOUT_LTR = 0,
00934 ULOC_LAYOUT_RTL = 1,
00935 ULOC_LAYOUT_TTB = 2,
00936 ULOC_LAYOUT_BTT = 3,
00937 ULOC_LAYOUT_UNKNOWN
00938 } ULayoutType;
00939
00948 U_STABLE ULayoutType U_EXPORT2
00949 uloc_getCharacterOrientation(const char* localeId,
00950 UErrorCode *status);
00951
00960 U_STABLE ULayoutType U_EXPORT2
00961 uloc_getLineOrientation(const char* localeId,
00962 UErrorCode *status);
00963
00970 typedef enum {
00971 ULOC_ACCEPT_FAILED = 0,
00972 ULOC_ACCEPT_VALID = 1,
00973 ULOC_ACCEPT_FALLBACK = 2
00974
00975
00976 } UAcceptResult;
00977
00978
00991 U_STABLE int32_t U_EXPORT2
00992 uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
00993 UAcceptResult *outResult,
00994 const char *httpAcceptLanguage,
00995 UEnumeration* availableLocales,
00996 UErrorCode *status);
00997
01011 U_STABLE int32_t U_EXPORT2
01012 uloc_acceptLanguage(char *result, int32_t resultAvailable,
01013 UAcceptResult *outResult, const char **acceptList,
01014 int32_t acceptListCount,
01015 UEnumeration* availableLocales,
01016 UErrorCode *status);
01017
01018
01031 U_STABLE int32_t U_EXPORT2
01032 uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity,
01033 UErrorCode *status);
01034
01035
01069 U_STABLE int32_t U_EXPORT2
01070 uloc_addLikelySubtags(const char* localeID,
01071 char* maximizedLocaleID,
01072 int32_t maximizedLocaleIDCapacity,
01073 UErrorCode* err);
01074
01075
01109 U_STABLE int32_t U_EXPORT2
01110 uloc_minimizeSubtags(const char* localeID,
01111 char* minimizedLocaleID,
01112 int32_t minimizedLocaleIDCapacity,
01113 UErrorCode* err);
01114
01138 U_STABLE int32_t U_EXPORT2
01139 uloc_forLanguageTag(const char* langtag,
01140 char* localeID,
01141 int32_t localeIDCapacity,
01142 int32_t* parsedLength,
01143 UErrorCode* err);
01144
01166 U_STABLE int32_t U_EXPORT2
01167 uloc_toLanguageTag(const char* localeID,
01168 char* langtag,
01169 int32_t langtagCapacity,
01170 UBool strict,
01171 UErrorCode* err);
01172
01194 U_STABLE const char* U_EXPORT2
01195 uloc_toUnicodeLocaleKey(const char* keyword);
01196
01225 U_STABLE const char* U_EXPORT2
01226 uloc_toUnicodeLocaleType(const char* keyword, const char* value);
01227
01240 U_STABLE const char* U_EXPORT2
01241 uloc_toLegacyKey(const char* keyword);
01242
01269 U_STABLE const char* U_EXPORT2
01270 uloc_toLegacyType(const char* keyword, const char* value);
01271
01272 #endif