00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ULOC_H
00022 #define ULOC_H
00023
00024 #include "unicode/utypes.h"
00025 #include "unicode/uenum.h"
00026
00201 #define ULOC_CHINESE "zh"
00202
00203 #define ULOC_ENGLISH "en"
00204
00205 #define ULOC_FRENCH "fr"
00206
00207 #define ULOC_GERMAN "de"
00208
00209 #define ULOC_ITALIAN "it"
00210
00211 #define ULOC_JAPANESE "ja"
00212
00213 #define ULOC_KOREAN "ko"
00214
00215 #define ULOC_SIMPLIFIED_CHINESE "zh_CN"
00216
00217 #define ULOC_TRADITIONAL_CHINESE "zh_TW"
00218
00220 #define ULOC_CANADA "en_CA"
00221
00222 #define ULOC_CANADA_FRENCH "fr_CA"
00223
00224 #define ULOC_CHINA "zh_CN"
00225
00226 #define ULOC_PRC "zh_CN"
00227
00228 #define ULOC_FRANCE "fr_FR"
00229
00230 #define ULOC_GERMANY "de_DE"
00231
00232 #define ULOC_ITALY "it_IT"
00233
00234 #define ULOC_JAPAN "ja_JP"
00235
00236 #define ULOC_KOREA "ko_KR"
00237
00238 #define ULOC_TAIWAN "zh_TW"
00239
00240 #define ULOC_UK "en_GB"
00241
00242 #define ULOC_US "en_US"
00243
00249 #define ULOC_LANG_CAPACITY 12
00250
00256 #define ULOC_COUNTRY_CAPACITY 4
00257
00262 #define ULOC_FULLNAME_CAPACITY 157
00263
00269 #define ULOC_SCRIPT_CAPACITY 6
00270
00275 #define ULOC_KEYWORDS_CAPACITY 96
00276
00281 #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
00282
00287 #define ULOC_KEYWORD_SEPARATOR '@'
00288
00294 #define ULOC_KEYWORD_SEPARATOR_UNICODE 0x40
00295
00300 #define ULOC_KEYWORD_ASSIGN '='
00301
00307 #define ULOC_KEYWORD_ASSIGN_UNICODE 0x3D
00308
00313 #define ULOC_KEYWORD_ITEM_SEPARATOR ';'
00314
00320 #define ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B
00321
00336 typedef enum {
00340 ULOC_ACTUAL_LOCALE = 0,
00344 ULOC_VALID_LOCALE = 1,
00345
00346 #ifndef U_HIDE_DEPRECATED_API
00347
00350 ULOC_REQUESTED_LOCALE = 2,
00351 #endif
00352
00353 ULOC_DATA_LOCALE_TYPE_LIMIT = 3
00354 } ULocDataLocaleType ;
00355
00356 #ifndef U_HIDE_SYSTEM_API
00357
00368 U_STABLE const char* U_EXPORT2
00369 uloc_getDefault(void);
00370
00388 U_STABLE void U_EXPORT2
00389 uloc_setDefault(const char* localeID,
00390 UErrorCode* status);
00391 #endif
00392
00405 U_STABLE int32_t U_EXPORT2
00406 uloc_getLanguage(const char* localeID,
00407 char* language,
00408 int32_t languageCapacity,
00409 UErrorCode* err);
00410
00423 U_STABLE int32_t U_EXPORT2
00424 uloc_getScript(const char* localeID,
00425 char* script,
00426 int32_t scriptCapacity,
00427 UErrorCode* err);
00428
00441 U_STABLE int32_t U_EXPORT2
00442 uloc_getCountry(const char* localeID,
00443 char* country,
00444 int32_t countryCapacity,
00445 UErrorCode* err);
00446
00459 U_STABLE int32_t U_EXPORT2
00460 uloc_getVariant(const char* localeID,
00461 char* variant,
00462 int32_t variantCapacity,
00463 UErrorCode* err);
00464
00465
00482 U_STABLE int32_t U_EXPORT2
00483 uloc_getName(const char* localeID,
00484 char* name,
00485 int32_t nameCapacity,
00486 UErrorCode* err);
00487
00505 U_STABLE int32_t U_EXPORT2
00506 uloc_canonicalize(const char* localeID,
00507 char* name,
00508 int32_t nameCapacity,
00509 UErrorCode* err);
00510
00518 U_STABLE const char* U_EXPORT2
00519 uloc_getISO3Language(const char* localeID);
00520
00521
00529 U_STABLE const char* U_EXPORT2
00530 uloc_getISO3Country(const char* localeID);
00531
00540 U_STABLE uint32_t U_EXPORT2
00541 uloc_getLCID(const char* localeID);
00542
00559 U_STABLE int32_t U_EXPORT2
00560 uloc_getDisplayLanguage(const char* locale,
00561 const char* displayLocale,
00562 UChar* language,
00563 int32_t languageCapacity,
00564 UErrorCode* status);
00565
00582 U_STABLE int32_t U_EXPORT2
00583 uloc_getDisplayScript(const char* locale,
00584 const char* displayLocale,
00585 UChar* script,
00586 int32_t scriptCapacity,
00587 UErrorCode* status);
00588
00607 U_STABLE int32_t U_EXPORT2
00608 uloc_getDisplayCountry(const char* locale,
00609 const char* displayLocale,
00610 UChar* country,
00611 int32_t countryCapacity,
00612 UErrorCode* status);
00613
00614
00631 U_STABLE int32_t U_EXPORT2
00632 uloc_getDisplayVariant(const char* locale,
00633 const char* displayLocale,
00634 UChar* variant,
00635 int32_t variantCapacity,
00636 UErrorCode* status);
00637
00678 U_STABLE int32_t U_EXPORT2
00679 uloc_getDisplayKeyword(const char* keyword,
00680 const char* displayLocale,
00681 UChar* dest,
00682 int32_t destCapacity,
00683 UErrorCode* status);
00704 U_STABLE int32_t U_EXPORT2
00705 uloc_getDisplayKeywordValue( const char* locale,
00706 const char* keyword,
00707 const char* displayLocale,
00708 UChar* dest,
00709 int32_t destCapacity,
00710 UErrorCode* status);
00727 U_STABLE int32_t U_EXPORT2
00728 uloc_getDisplayName(const char* localeID,
00729 const char* inLocaleID,
00730 UChar* result,
00731 int32_t maxResultSize,
00732 UErrorCode* err);
00733
00734
00745 U_STABLE const char* U_EXPORT2
00746 uloc_getAvailable(int32_t n);
00747
00754 U_STABLE int32_t U_EXPORT2 uloc_countAvailable(void);
00755
00767 U_STABLE const char* const* U_EXPORT2
00768 uloc_getISOLanguages(void);
00769
00779 U_STABLE const char* const* U_EXPORT2
00780 uloc_getISOCountries(void);
00781
00795 U_STABLE int32_t U_EXPORT2
00796 uloc_getParent(const char* localeID,
00797 char* parent,
00798 int32_t parentCapacity,
00799 UErrorCode* err);
00800
00801
00802
00803
00826 U_STABLE int32_t U_EXPORT2
00827 uloc_getBaseName(const char* localeID,
00828 char* name,
00829 int32_t nameCapacity,
00830 UErrorCode* err);
00831
00841 U_STABLE UEnumeration* U_EXPORT2
00842 uloc_openKeywords(const char* localeID,
00843 UErrorCode* status);
00844
00856 U_STABLE int32_t U_EXPORT2
00857 uloc_getKeywordValue(const char* localeID,
00858 const char* keywordName,
00859 char* buffer, int32_t bufferCapacity,
00860 UErrorCode* status);
00861
00862
00885 U_STABLE int32_t U_EXPORT2
00886 uloc_setKeywordValue(const char* keywordName,
00887 const char* keywordValue,
00888 char* buffer, int32_t bufferCapacity,
00889 UErrorCode* status);
00890
00905 U_STABLE UBool U_EXPORT2
00906 uloc_isRightToLeft(const char *locale);
00907
00913 typedef enum {
00914 ULOC_LAYOUT_LTR = 0,
00915 ULOC_LAYOUT_RTL = 1,
00916 ULOC_LAYOUT_TTB = 2,
00917 ULOC_LAYOUT_BTT = 3,
00918 ULOC_LAYOUT_UNKNOWN
00919 } ULayoutType;
00920
00929 U_STABLE ULayoutType U_EXPORT2
00930 uloc_getCharacterOrientation(const char* localeId,
00931 UErrorCode *status);
00932
00941 U_STABLE ULayoutType U_EXPORT2
00942 uloc_getLineOrientation(const char* localeId,
00943 UErrorCode *status);
00944
00951 typedef enum {
00952 ULOC_ACCEPT_FAILED = 0,
00953 ULOC_ACCEPT_VALID = 1,
00954 ULOC_ACCEPT_FALLBACK = 2
00955
00956
00957 } UAcceptResult;
00958
00959
00972 U_STABLE int32_t U_EXPORT2
00973 uloc_acceptLanguageFromHTTP(char *result, int32_t resultAvailable,
00974 UAcceptResult *outResult,
00975 const char *httpAcceptLanguage,
00976 UEnumeration* availableLocales,
00977 UErrorCode *status);
00978
00992 U_STABLE int32_t U_EXPORT2
00993 uloc_acceptLanguage(char *result, int32_t resultAvailable,
00994 UAcceptResult *outResult, const char **acceptList,
00995 int32_t acceptListCount,
00996 UEnumeration* availableLocales,
00997 UErrorCode *status);
00998
00999
01012 U_STABLE int32_t U_EXPORT2
01013 uloc_getLocaleForLCID(uint32_t hostID, char *locale, int32_t localeCapacity,
01014 UErrorCode *status);
01015
01016
01050 U_STABLE int32_t U_EXPORT2
01051 uloc_addLikelySubtags(const char* localeID,
01052 char* maximizedLocaleID,
01053 int32_t maximizedLocaleIDCapacity,
01054 UErrorCode* err);
01055
01056
01090 U_STABLE int32_t U_EXPORT2
01091 uloc_minimizeSubtags(const char* localeID,
01092 char* minimizedLocaleID,
01093 int32_t minimizedLocaleIDCapacity,
01094 UErrorCode* err);
01095
01119 U_STABLE int32_t U_EXPORT2
01120 uloc_forLanguageTag(const char* langtag,
01121 char* localeID,
01122 int32_t localeIDCapacity,
01123 int32_t* parsedLength,
01124 UErrorCode* err);
01125
01147 U_STABLE int32_t U_EXPORT2
01148 uloc_toLanguageTag(const char* localeID,
01149 char* langtag,
01150 int32_t langtagCapacity,
01151 UBool strict,
01152 UErrorCode* err);
01153
01175 U_STABLE const char* U_EXPORT2
01176 uloc_toUnicodeLocaleKey(const char* keyword);
01177
01206 U_STABLE const char* U_EXPORT2
01207 uloc_toUnicodeLocaleType(const char* keyword, const char* value);
01208
01221 U_STABLE const char* U_EXPORT2
01222 uloc_toLegacyKey(const char* keyword);
01223
01250 U_STABLE const char* U_EXPORT2
01251 uloc_toLegacyType(const char* keyword, const char* value);
01252
01253 #endif