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
00255 #define ULOC_SCRIPT_CAPACITY 6
00256
00261 #define ULOC_COUNTRY_CAPACITY 4
00262
00267 #define ULOC_FULLNAME_CAPACITY 56
00268
00272 #define ULOC_KEYWORDS_CAPACITY 50
00273
00277 #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
00278
00293 typedef enum {
00297 ULOC_ACTUAL_LOCALE = 0,
00301 ULOC_VALID_LOCALE = 1,
00305 ULOC_REQUESTED_LOCALE = 2,
00306 ULOC_DATA_LOCALE_TYPE_LIMIT
00307 } ULocDataLocaleType ;
00308
00309
00321 U_CAPI const char* U_EXPORT2
00322 uloc_getDefault(void);
00323
00341 U_CAPI void U_EXPORT2
00342 uloc_setDefault(const char* localeID,
00343 UErrorCode* status);
00344
00357 U_CAPI int32_t U_EXPORT2
00358 uloc_getLanguage(const char* localeID,
00359 char* language,
00360 int32_t languageCapacity,
00361 UErrorCode* err);
00362
00375 U_CAPI int32_t U_EXPORT2
00376 uloc_getScript(const char* localeID,
00377 char* script,
00378 int32_t scriptCapacity,
00379 UErrorCode* err);
00380
00393 U_CAPI int32_t U_EXPORT2
00394 uloc_getCountry(const char* localeID,
00395 char* country,
00396 int32_t countryCapacity,
00397 UErrorCode* err);
00398
00411 U_CAPI int32_t U_EXPORT2
00412 uloc_getVariant(const char* localeID,
00413 char* variant,
00414 int32_t variantCapacity,
00415 UErrorCode* err);
00416
00417
00434 U_CAPI int32_t U_EXPORT2
00435 uloc_getName(const char* localeID,
00436 char* name,
00437 int32_t nameCapacity,
00438 UErrorCode* err);
00439
00457 U_CAPI int32_t U_EXPORT2
00458 uloc_canonicalize(const char* localeID,
00459 char* name,
00460 int32_t nameCapacity,
00461 UErrorCode* err);
00462
00470 U_CAPI const char* U_EXPORT2
00471 uloc_getISO3Language(const char* localeID);
00472
00473
00481 U_CAPI const char* U_EXPORT2
00482 uloc_getISO3Country(const char* localeID);
00483
00492 U_CAPI uint32_t U_EXPORT2
00493 uloc_getLCID(const char* localeID);
00494
00511 U_CAPI int32_t U_EXPORT2
00512 uloc_getDisplayLanguage(const char* locale,
00513 const char* displayLocale,
00514 UChar* language,
00515 int32_t languageCapacity,
00516 UErrorCode* status);
00517
00534 U_CAPI int32_t U_EXPORT2
00535 uloc_getDisplayScript(const char* locale,
00536 const char* displayLocale,
00537 UChar* script,
00538 int32_t scriptCapacity,
00539 UErrorCode* status);
00540
00557 U_CAPI int32_t U_EXPORT2
00558 uloc_getDisplayCountry(const char* locale,
00559 const char* displayLocale,
00560 UChar* country,
00561 int32_t countryCapacity,
00562 UErrorCode* status);
00563
00564
00581 U_CAPI int32_t U_EXPORT2
00582 uloc_getDisplayVariant(const char* locale,
00583 const char* displayLocale,
00584 UChar* variant,
00585 int32_t variantCapacity,
00586 UErrorCode* status);
00587
00628 U_CAPI int32_t U_EXPORT2
00629 uloc_getDisplayKeyword(const char* keyword,
00630 const char* displayLocale,
00631 UChar* dest,
00632 int32_t destCapacity,
00633 UErrorCode* status);
00654 U_CAPI int32_t U_EXPORT2
00655 uloc_getDisplayKeywordValue( const char* locale,
00656 const char* keyword,
00657 const char* displayLocale,
00658 UChar* dest,
00659 int32_t destCapacity,
00660 UErrorCode* status);
00677 U_CAPI int32_t U_EXPORT2
00678 uloc_getDisplayName(const char* localeID,
00679 const char* inLocaleID,
00680 UChar* result,
00681 int32_t maxResultSize,
00682 UErrorCode* err);
00683
00684
00695 U_CAPI const char* U_EXPORT2
00696 uloc_getAvailable(int32_t n);
00697
00704 U_CAPI int32_t U_EXPORT2 uloc_countAvailable(void);
00705
00715 U_CAPI const char* const* U_EXPORT2
00716 uloc_getISOLanguages(void);
00717
00727 U_CAPI const char* const* U_EXPORT2
00728 uloc_getISOCountries(void);
00729
00743 U_CAPI int32_t U_EXPORT2
00744 uloc_getParent(const char* localeID,
00745 char* parent,
00746 int32_t parentCapacity,
00747 UErrorCode* err);
00748
00749
00755 #define ULOC_KEYWORD_SEPARATOR '@'
00756
00760 #define ULOC_KEYWORD_ASSIGN '='
00761
00765 #define ULOC_KEYWORD_ITEM_SEPARATOR ';'
00766
00786 U_CAPI int32_t U_EXPORT2
00787 uloc_getBaseName(const char* localeID,
00788 char* name,
00789 int32_t nameCapacity,
00790 UErrorCode* err);
00791
00801 U_CAPI UEnumeration* U_EXPORT2
00802 uloc_openKeywords(const char* localeID,
00803 UErrorCode* status);
00804
00816 U_CAPI int32_t U_EXPORT2
00817 uloc_getKeywordValue(const char* localeID,
00818 const char* keywordName,
00819 char* buffer, int32_t bufferCapacity,
00820 UErrorCode* status);
00821
00822
00823
00824
00825 #endif
00826
00827
00828