xref: /aosp_15_r20/external/icu/libicu/ndk_headers/unicode/uloc.h (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1*0e209d39SAndroid Build Coastguard Worker // © 2016 and later: Unicode, Inc. and others.
2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html
3*0e209d39SAndroid Build Coastguard Worker /*
4*0e209d39SAndroid Build Coastguard Worker **********************************************************************
5*0e209d39SAndroid Build Coastguard Worker *   Copyright (C) 1997-2016, International Business Machines
6*0e209d39SAndroid Build Coastguard Worker *   Corporation and others.  All Rights Reserved.
7*0e209d39SAndroid Build Coastguard Worker **********************************************************************
8*0e209d39SAndroid Build Coastguard Worker *
9*0e209d39SAndroid Build Coastguard Worker * File ULOC.H
10*0e209d39SAndroid Build Coastguard Worker *
11*0e209d39SAndroid Build Coastguard Worker * Modification History:
12*0e209d39SAndroid Build Coastguard Worker *
13*0e209d39SAndroid Build Coastguard Worker *   Date        Name        Description
14*0e209d39SAndroid Build Coastguard Worker *   04/01/97    aliu        Creation.
15*0e209d39SAndroid Build Coastguard Worker *   08/22/98    stephen     JDK 1.2 sync.
16*0e209d39SAndroid Build Coastguard Worker *   12/08/98    rtg         New C API for Locale
17*0e209d39SAndroid Build Coastguard Worker *   03/30/99    damiba      overhaul
18*0e209d39SAndroid Build Coastguard Worker *   03/31/99    helena      Javadoc for uloc functions.
19*0e209d39SAndroid Build Coastguard Worker *   04/15/99    Madhu       Updated Javadoc
20*0e209d39SAndroid Build Coastguard Worker ********************************************************************************
21*0e209d39SAndroid Build Coastguard Worker */
22*0e209d39SAndroid Build Coastguard Worker 
23*0e209d39SAndroid Build Coastguard Worker #ifndef ULOC_H
24*0e209d39SAndroid Build Coastguard Worker #define ULOC_H
25*0e209d39SAndroid Build Coastguard Worker 
26*0e209d39SAndroid Build Coastguard Worker #include "unicode/utypes.h"
27*0e209d39SAndroid Build Coastguard Worker #include "unicode/uenum.h"
28*0e209d39SAndroid Build Coastguard Worker 
29*0e209d39SAndroid Build Coastguard Worker /**
30*0e209d39SAndroid Build Coastguard Worker  * @addtogroup icu4c ICU4C
31*0e209d39SAndroid Build Coastguard Worker  * @{
32*0e209d39SAndroid Build Coastguard Worker  * \file
33*0e209d39SAndroid Build Coastguard Worker  * \brief C API: Locale ID functionality similar to C++ class Locale
34*0e209d39SAndroid Build Coastguard Worker  *
35*0e209d39SAndroid Build Coastguard Worker  * <h2> ULoc C API for Locale </h2>
36*0e209d39SAndroid Build Coastguard Worker  * A <code>Locale</code> represents a specific geographical, political,
37*0e209d39SAndroid Build Coastguard Worker  * or cultural region. An operation that requires a <code>Locale</code> to perform
38*0e209d39SAndroid Build Coastguard Worker  * its task is called <em>locale-sensitive</em> and uses the <code>Locale</code>
39*0e209d39SAndroid Build Coastguard Worker  * to tailor information for the user. For example, displaying a number
40*0e209d39SAndroid Build Coastguard Worker  * is a locale-sensitive operation--the number should be formatted
41*0e209d39SAndroid Build Coastguard Worker  * according to the customs/conventions of the user's native country,
42*0e209d39SAndroid Build Coastguard Worker  * region, or culture.  In the C APIs, a locales is simply a const char string.
43*0e209d39SAndroid Build Coastguard Worker  *
44*0e209d39SAndroid Build Coastguard Worker  * <P>
45*0e209d39SAndroid Build Coastguard Worker  * You create a <code>Locale</code> with one of the three options listed below.
46*0e209d39SAndroid Build Coastguard Worker  * Each of the component is separated by '_' in the locale string.
47*0e209d39SAndroid Build Coastguard Worker  * \htmlonly<blockquote>\endhtmlonly
48*0e209d39SAndroid Build Coastguard Worker  * <pre>
49*0e209d39SAndroid Build Coastguard Worker  * \code
50*0e209d39SAndroid Build Coastguard Worker  *       newLanguage
51*0e209d39SAndroid Build Coastguard Worker  *
52*0e209d39SAndroid Build Coastguard Worker  *       newLanguage + newCountry
53*0e209d39SAndroid Build Coastguard Worker  *
54*0e209d39SAndroid Build Coastguard Worker  *       newLanguage + newCountry + newVariant
55*0e209d39SAndroid Build Coastguard Worker  * \endcode
56*0e209d39SAndroid Build Coastguard Worker  * </pre>
57*0e209d39SAndroid Build Coastguard Worker  * \htmlonly</blockquote>\endhtmlonly
58*0e209d39SAndroid Build Coastguard Worker  * The first option is a valid <STRONG>ISO
59*0e209d39SAndroid Build Coastguard Worker  * Language Code.</STRONG> These codes are the lower-case two-letter
60*0e209d39SAndroid Build Coastguard Worker  * codes as defined by ISO-639.
61*0e209d39SAndroid Build Coastguard Worker  * You can find a full list of these codes at a number of sites, such as:
62*0e209d39SAndroid Build Coastguard Worker  * <BR><a href ="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt">
63*0e209d39SAndroid Build Coastguard Worker  * http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt</a>
64*0e209d39SAndroid Build Coastguard Worker  *
65*0e209d39SAndroid Build Coastguard Worker  * <P>
66*0e209d39SAndroid Build Coastguard Worker  * The second option includes an additional <STRONG>ISO Country
67*0e209d39SAndroid Build Coastguard Worker  * Code.</STRONG> These codes are the upper-case two-letter codes
68*0e209d39SAndroid Build Coastguard Worker  * as defined by ISO-3166.
69*0e209d39SAndroid Build Coastguard Worker  * You can find a full list of these codes at a number of sites, such as:
70*0e209d39SAndroid Build Coastguard Worker  * <BR><a href="http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html">
71*0e209d39SAndroid Build Coastguard Worker  * http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html</a>
72*0e209d39SAndroid Build Coastguard Worker  *
73*0e209d39SAndroid Build Coastguard Worker  * <P>
74*0e209d39SAndroid Build Coastguard Worker  * The third option requires another additional information--the
75*0e209d39SAndroid Build Coastguard Worker  * <STRONG>Variant.</STRONG>
76*0e209d39SAndroid Build Coastguard Worker  * The Variant codes are vendor and browser-specific.
77*0e209d39SAndroid Build Coastguard Worker  * For example, use WIN for Windows, MAC for Macintosh, and POSIX for POSIX.
78*0e209d39SAndroid Build Coastguard Worker  * Where there are two variants, separate them with an underscore, and
79*0e209d39SAndroid Build Coastguard Worker  * put the most important one first. For
80*0e209d39SAndroid Build Coastguard Worker  * example, a Traditional Spanish collation might be referenced, with
81*0e209d39SAndroid Build Coastguard Worker  * "ES", "ES", "Traditional_WIN".
82*0e209d39SAndroid Build Coastguard Worker  *
83*0e209d39SAndroid Build Coastguard Worker  * <P>
84*0e209d39SAndroid Build Coastguard Worker  * Because a <code>Locale</code> is just an identifier for a region,
85*0e209d39SAndroid Build Coastguard Worker  * no validity check is performed when you specify a <code>Locale</code>.
86*0e209d39SAndroid Build Coastguard Worker  * If you want to see whether particular resources are available for the
87*0e209d39SAndroid Build Coastguard Worker  * <code>Locale</code> you asked for, you must query those resources. For
88*0e209d39SAndroid Build Coastguard Worker  * example, ask the <code>UNumberFormat</code> for the locales it supports
89*0e209d39SAndroid Build Coastguard Worker  * using its <code>getAvailable</code> method.
90*0e209d39SAndroid Build Coastguard Worker  * <BR><STRONG>Note:</STRONG> When you ask for a resource for a particular
91*0e209d39SAndroid Build Coastguard Worker  * locale, you get back the best available match, not necessarily
92*0e209d39SAndroid Build Coastguard Worker  * precisely what you asked for. For more information, look at
93*0e209d39SAndroid Build Coastguard Worker  * <code>UResourceBundle</code>.
94*0e209d39SAndroid Build Coastguard Worker  *
95*0e209d39SAndroid Build Coastguard Worker  * <P>
96*0e209d39SAndroid Build Coastguard Worker  * The <code>Locale</code> provides a number of convenient constants
97*0e209d39SAndroid Build Coastguard Worker  * that you can use to specify the commonly used
98*0e209d39SAndroid Build Coastguard Worker  * locales. For example, the following refers to a locale
99*0e209d39SAndroid Build Coastguard Worker  * for the United States:
100*0e209d39SAndroid Build Coastguard Worker  * \htmlonly<blockquote>\endhtmlonly
101*0e209d39SAndroid Build Coastguard Worker  * <pre>
102*0e209d39SAndroid Build Coastguard Worker  * \code
103*0e209d39SAndroid Build Coastguard Worker  *       ULOC_US
104*0e209d39SAndroid Build Coastguard Worker  * \endcode
105*0e209d39SAndroid Build Coastguard Worker  * </pre>
106*0e209d39SAndroid Build Coastguard Worker  * \htmlonly</blockquote>\endhtmlonly
107*0e209d39SAndroid Build Coastguard Worker  *
108*0e209d39SAndroid Build Coastguard Worker  * <P>
109*0e209d39SAndroid Build Coastguard Worker  * Once you've specified a locale you can query it for information about
110*0e209d39SAndroid Build Coastguard Worker  * itself. Use <code>uloc_getCountry</code> to get the ISO Country Code and
111*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_getLanguage</code> to get the ISO Language Code. You can
112*0e209d39SAndroid Build Coastguard Worker  * use <code>uloc_getDisplayCountry</code> to get the
113*0e209d39SAndroid Build Coastguard Worker  * name of the country suitable for displaying to the user. Similarly,
114*0e209d39SAndroid Build Coastguard Worker  * you can use <code>uloc_getDisplayLanguage</code> to get the name of
115*0e209d39SAndroid Build Coastguard Worker  * the language suitable for displaying to the user. Interestingly,
116*0e209d39SAndroid Build Coastguard Worker  * the <code>uloc_getDisplayXXX</code> methods are themselves locale-sensitive
117*0e209d39SAndroid Build Coastguard Worker  * and have two versions: one that uses the default locale and one
118*0e209d39SAndroid Build Coastguard Worker  * that takes a locale as an argument and displays the name or country in
119*0e209d39SAndroid Build Coastguard Worker  * a language appropriate to that locale.
120*0e209d39SAndroid Build Coastguard Worker  *
121*0e209d39SAndroid Build Coastguard Worker  * <P>
122*0e209d39SAndroid Build Coastguard Worker  * The ICU provides a number of services that perform locale-sensitive
123*0e209d39SAndroid Build Coastguard Worker  * operations. For example, the <code>unum_xxx</code> functions format
124*0e209d39SAndroid Build Coastguard Worker  * numbers, currency, or percentages in a locale-sensitive manner.
125*0e209d39SAndroid Build Coastguard Worker  * </P>
126*0e209d39SAndroid Build Coastguard Worker  * \htmlonly<blockquote>\endhtmlonly
127*0e209d39SAndroid Build Coastguard Worker  * <pre>
128*0e209d39SAndroid Build Coastguard Worker  * \code
129*0e209d39SAndroid Build Coastguard Worker  *     UErrorCode success = U_ZERO_ERROR;
130*0e209d39SAndroid Build Coastguard Worker  *     UNumberFormat *nf;
131*0e209d39SAndroid Build Coastguard Worker  *     const char* myLocale = "fr_FR";
132*0e209d39SAndroid Build Coastguard Worker  *
133*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_DEFAULT, NULL, success );
134*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
135*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_CURRENCY, NULL, success );
136*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
137*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_PERCENT, NULL, success );
138*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
139*0e209d39SAndroid Build Coastguard Worker  * \endcode
140*0e209d39SAndroid Build Coastguard Worker  * </pre>
141*0e209d39SAndroid Build Coastguard Worker  * \htmlonly</blockquote>\endhtmlonly
142*0e209d39SAndroid Build Coastguard Worker  * Each of these methods has two variants; one with an explicit locale
143*0e209d39SAndroid Build Coastguard Worker  * and one without; the latter using the default locale.
144*0e209d39SAndroid Build Coastguard Worker  * \htmlonly<blockquote>\endhtmlonly
145*0e209d39SAndroid Build Coastguard Worker  * <pre>
146*0e209d39SAndroid Build Coastguard Worker  * \code
147*0e209d39SAndroid Build Coastguard Worker  *
148*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_DEFAULT, myLocale, success );
149*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
150*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_CURRENCY, myLocale, success );
151*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
152*0e209d39SAndroid Build Coastguard Worker  *     nf = unum_open( UNUM_PERCENT, myLocale, success );
153*0e209d39SAndroid Build Coastguard Worker  *     unum_close(nf);
154*0e209d39SAndroid Build Coastguard Worker  * \endcode
155*0e209d39SAndroid Build Coastguard Worker  * </pre>
156*0e209d39SAndroid Build Coastguard Worker  * \htmlonly</blockquote>\endhtmlonly
157*0e209d39SAndroid Build Coastguard Worker  * A <code>Locale</code> is the mechanism for identifying the kind of services
158*0e209d39SAndroid Build Coastguard Worker  * (<code>UNumberFormat</code>) that you would like to get. The locale is
159*0e209d39SAndroid Build Coastguard Worker  * <STRONG>just</STRONG> a mechanism for identifying these services.
160*0e209d39SAndroid Build Coastguard Worker  *
161*0e209d39SAndroid Build Coastguard Worker  * <P>
162*0e209d39SAndroid Build Coastguard Worker  * Each international service that performs locale-sensitive operations
163*0e209d39SAndroid Build Coastguard Worker  * allows you
164*0e209d39SAndroid Build Coastguard Worker  * to get all the available objects of that type. You can sift
165*0e209d39SAndroid Build Coastguard Worker  * through these objects by language, country, or variant,
166*0e209d39SAndroid Build Coastguard Worker  * and use the display names to present a menu to the user.
167*0e209d39SAndroid Build Coastguard Worker  * For example, you can create a menu of all the collation objects
168*0e209d39SAndroid Build Coastguard Worker  * suitable for a given language. Such classes implement these
169*0e209d39SAndroid Build Coastguard Worker  * three class methods:
170*0e209d39SAndroid Build Coastguard Worker  * \htmlonly<blockquote>\endhtmlonly
171*0e209d39SAndroid Build Coastguard Worker  * <pre>
172*0e209d39SAndroid Build Coastguard Worker  * \code
173*0e209d39SAndroid Build Coastguard Worker  *       const char* uloc_getAvailable(int32_t index);
174*0e209d39SAndroid Build Coastguard Worker  *       int32_t uloc_countAvailable();
175*0e209d39SAndroid Build Coastguard Worker  *       int32_t
176*0e209d39SAndroid Build Coastguard Worker  *       uloc_getDisplayName(const char* localeID,
177*0e209d39SAndroid Build Coastguard Worker  *                 const char* inLocaleID,
178*0e209d39SAndroid Build Coastguard Worker  *                 UChar* result,
179*0e209d39SAndroid Build Coastguard Worker  *                 int32_t maxResultSize,
180*0e209d39SAndroid Build Coastguard Worker  *                  UErrorCode* err);
181*0e209d39SAndroid Build Coastguard Worker  *
182*0e209d39SAndroid Build Coastguard Worker  * \endcode
183*0e209d39SAndroid Build Coastguard Worker  * </pre>
184*0e209d39SAndroid Build Coastguard Worker  * \htmlonly</blockquote>\endhtmlonly
185*0e209d39SAndroid Build Coastguard Worker  * <P>
186*0e209d39SAndroid Build Coastguard Worker  * Concerning POSIX/RFC1766 Locale IDs,
187*0e209d39SAndroid Build Coastguard Worker  *  the getLanguage/getCountry/getVariant/getName functions do understand
188*0e209d39SAndroid Build Coastguard Worker  * the POSIX type form of  language_COUNTRY.ENCODING\@VARIANT
189*0e209d39SAndroid Build Coastguard Worker  * and if there is not an ICU-stype variant, uloc_getVariant() for example
190*0e209d39SAndroid Build Coastguard Worker  * will return the one listed after the \@at sign. As well, the hyphen
191*0e209d39SAndroid Build Coastguard Worker  * "-" is recognized as a country/variant separator similarly to RFC1766.
192*0e209d39SAndroid Build Coastguard Worker  * So for example, "en-us" will be interpreted as en_US.
193*0e209d39SAndroid Build Coastguard Worker  * As a result, uloc_getName() is far from a no-op, and will have the
194*0e209d39SAndroid Build Coastguard Worker  * effect of converting POSIX/RFC1766 IDs into ICU form, although it does
195*0e209d39SAndroid Build Coastguard Worker  * NOT map any of the actual codes (i.e. russian->ru) in any way.
196*0e209d39SAndroid Build Coastguard Worker  * Applications should call uloc_getName() at the point where a locale ID
197*0e209d39SAndroid Build Coastguard Worker  * is coming from an external source (user entry, OS, web browser)
198*0e209d39SAndroid Build Coastguard Worker  * and pass the resulting string to other ICU functions.  For example,
199*0e209d39SAndroid Build Coastguard Worker  * don't use de-de\@EURO as an argument to resourcebundle.
200*0e209d39SAndroid Build Coastguard Worker  *
201*0e209d39SAndroid Build Coastguard Worker  * @see UResourceBundle
202*0e209d39SAndroid Build Coastguard Worker  */
203*0e209d39SAndroid Build Coastguard Worker 
204*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
205*0e209d39SAndroid Build Coastguard Worker #define ULOC_CHINESE            "zh"
206*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
207*0e209d39SAndroid Build Coastguard Worker #define ULOC_ENGLISH            "en"
208*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
209*0e209d39SAndroid Build Coastguard Worker #define ULOC_FRENCH             "fr"
210*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
211*0e209d39SAndroid Build Coastguard Worker #define ULOC_GERMAN             "de"
212*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
213*0e209d39SAndroid Build Coastguard Worker #define ULOC_ITALIAN            "it"
214*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
215*0e209d39SAndroid Build Coastguard Worker #define ULOC_JAPANESE           "ja"
216*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
217*0e209d39SAndroid Build Coastguard Worker #define ULOC_KOREAN             "ko"
218*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
219*0e209d39SAndroid Build Coastguard Worker #define ULOC_SIMPLIFIED_CHINESE "zh_CN"
220*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this language. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
221*0e209d39SAndroid Build Coastguard Worker #define ULOC_TRADITIONAL_CHINESE "zh_TW"
222*0e209d39SAndroid Build Coastguard Worker 
223*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
224*0e209d39SAndroid Build Coastguard Worker #define ULOC_CANADA         "en_CA"
225*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
226*0e209d39SAndroid Build Coastguard Worker #define ULOC_CANADA_FRENCH  "fr_CA"
227*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
228*0e209d39SAndroid Build Coastguard Worker #define ULOC_CHINA          "zh_CN"
229*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
230*0e209d39SAndroid Build Coastguard Worker #define ULOC_PRC            "zh_CN"
231*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
232*0e209d39SAndroid Build Coastguard Worker #define ULOC_FRANCE         "fr_FR"
233*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
234*0e209d39SAndroid Build Coastguard Worker #define ULOC_GERMANY        "de_DE"
235*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
236*0e209d39SAndroid Build Coastguard Worker #define ULOC_ITALY          "it_IT"
237*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
238*0e209d39SAndroid Build Coastguard Worker #define ULOC_JAPAN          "ja_JP"
239*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
240*0e209d39SAndroid Build Coastguard Worker #define ULOC_KOREA          "ko_KR"
241*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
242*0e209d39SAndroid Build Coastguard Worker #define ULOC_TAIWAN         "zh_TW"
243*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
244*0e209d39SAndroid Build Coastguard Worker #define ULOC_UK             "en_GB"
245*0e209d39SAndroid Build Coastguard Worker /** Useful constant for this country/region. \xrefitem stable "Stable" "Stable List" ICU 2.0 */
246*0e209d39SAndroid Build Coastguard Worker #define ULOC_US             "en_US"
247*0e209d39SAndroid Build Coastguard Worker 
248*0e209d39SAndroid Build Coastguard Worker /**
249*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum size of the language part of a locale ID.
250*0e209d39SAndroid Build Coastguard Worker  * (including the terminating NULL).
251*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
252*0e209d39SAndroid Build Coastguard Worker  */
253*0e209d39SAndroid Build Coastguard Worker #define ULOC_LANG_CAPACITY 12
254*0e209d39SAndroid Build Coastguard Worker 
255*0e209d39SAndroid Build Coastguard Worker /**
256*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum size of the country part of a locale ID
257*0e209d39SAndroid Build Coastguard Worker  * (including the terminating NULL).
258*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
259*0e209d39SAndroid Build Coastguard Worker  */
260*0e209d39SAndroid Build Coastguard Worker #define ULOC_COUNTRY_CAPACITY 4
261*0e209d39SAndroid Build Coastguard Worker /**
262*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum size of the whole locale ID
263*0e209d39SAndroid Build Coastguard Worker  * (including the terminating NULL and all keywords).
264*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
265*0e209d39SAndroid Build Coastguard Worker  */
266*0e209d39SAndroid Build Coastguard Worker #define ULOC_FULLNAME_CAPACITY 157
267*0e209d39SAndroid Build Coastguard Worker 
268*0e209d39SAndroid Build Coastguard Worker /**
269*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum size of the script part of a locale ID
270*0e209d39SAndroid Build Coastguard Worker  * (including the terminating NULL).
271*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
272*0e209d39SAndroid Build Coastguard Worker  */
273*0e209d39SAndroid Build Coastguard Worker #define ULOC_SCRIPT_CAPACITY 6
274*0e209d39SAndroid Build Coastguard Worker 
275*0e209d39SAndroid Build Coastguard Worker /**
276*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum size of keywords in a locale
277*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
278*0e209d39SAndroid Build Coastguard Worker  */
279*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORDS_CAPACITY 96
280*0e209d39SAndroid Build Coastguard Worker 
281*0e209d39SAndroid Build Coastguard Worker /**
282*0e209d39SAndroid Build Coastguard Worker  * Useful constant for the maximum total size of keywords and their values in a locale
283*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
284*0e209d39SAndroid Build Coastguard Worker  */
285*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_AND_VALUES_CAPACITY 100
286*0e209d39SAndroid Build Coastguard Worker 
287*0e209d39SAndroid Build Coastguard Worker /**
288*0e209d39SAndroid Build Coastguard Worker  * Invariant character separating keywords from the locale string
289*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
290*0e209d39SAndroid Build Coastguard Worker  */
291*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_SEPARATOR '@'
292*0e209d39SAndroid Build Coastguard Worker 
293*0e209d39SAndroid Build Coastguard Worker /**
294*0e209d39SAndroid Build Coastguard Worker   * Unicode code point for '@' separating keywords from the locale string.
295*0e209d39SAndroid Build Coastguard Worker   * @see ULOC_KEYWORD_SEPARATOR
296*0e209d39SAndroid Build Coastguard Worker   * \xrefitem stable "Stable" "Stable List" ICU 4.6
297*0e209d39SAndroid Build Coastguard Worker   */
298*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_SEPARATOR_UNICODE 0x40
299*0e209d39SAndroid Build Coastguard Worker 
300*0e209d39SAndroid Build Coastguard Worker /**
301*0e209d39SAndroid Build Coastguard Worker  * Invariant character for assigning value to a keyword
302*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
303*0e209d39SAndroid Build Coastguard Worker  */
304*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_ASSIGN '='
305*0e209d39SAndroid Build Coastguard Worker 
306*0e209d39SAndroid Build Coastguard Worker /**
307*0e209d39SAndroid Build Coastguard Worker   * Unicode code point for '=' for assigning value to a keyword.
308*0e209d39SAndroid Build Coastguard Worker   * @see ULOC_KEYWORD_ASSIGN
309*0e209d39SAndroid Build Coastguard Worker   * \xrefitem stable "Stable" "Stable List" ICU 4.6
310*0e209d39SAndroid Build Coastguard Worker   */
311*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_ASSIGN_UNICODE 0x3D
312*0e209d39SAndroid Build Coastguard Worker 
313*0e209d39SAndroid Build Coastguard Worker /**
314*0e209d39SAndroid Build Coastguard Worker  * Invariant character separating keywords
315*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
316*0e209d39SAndroid Build Coastguard Worker  */
317*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_ITEM_SEPARATOR ';'
318*0e209d39SAndroid Build Coastguard Worker 
319*0e209d39SAndroid Build Coastguard Worker /**
320*0e209d39SAndroid Build Coastguard Worker   * Unicode code point for ';' separating keywords
321*0e209d39SAndroid Build Coastguard Worker   * @see ULOC_KEYWORD_ITEM_SEPARATOR
322*0e209d39SAndroid Build Coastguard Worker   * \xrefitem stable "Stable" "Stable List" ICU 4.6
323*0e209d39SAndroid Build Coastguard Worker   */
324*0e209d39SAndroid Build Coastguard Worker #define ULOC_KEYWORD_ITEM_SEPARATOR_UNICODE 0x3B
325*0e209d39SAndroid Build Coastguard Worker 
326*0e209d39SAndroid Build Coastguard Worker /**
327*0e209d39SAndroid Build Coastguard Worker  * Constants for *_getLocale()
328*0e209d39SAndroid Build Coastguard Worker  * Allow user to select whether she wants information on
329*0e209d39SAndroid Build Coastguard Worker  * requested, valid or actual locale.
330*0e209d39SAndroid Build Coastguard Worker  * For example, a collator for "en_US_CALIFORNIA" was
331*0e209d39SAndroid Build Coastguard Worker  * requested. In the current state of ICU (2.0),
332*0e209d39SAndroid Build Coastguard Worker  * the requested locale is "en_US_CALIFORNIA",
333*0e209d39SAndroid Build Coastguard Worker  * the valid locale is "en_US" (most specific locale supported by ICU)
334*0e209d39SAndroid Build Coastguard Worker  * and the actual locale is "root" (the collation data comes unmodified
335*0e209d39SAndroid Build Coastguard Worker  * from the UCA)
336*0e209d39SAndroid Build Coastguard Worker  * The locale is considered supported by ICU if there is a core ICU bundle
337*0e209d39SAndroid Build Coastguard Worker  * for that locale (although it may be empty).
338*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.1
339*0e209d39SAndroid Build Coastguard Worker  */
340*0e209d39SAndroid Build Coastguard Worker typedef enum {
341*0e209d39SAndroid Build Coastguard Worker   /** This is locale the data actually comes from
342*0e209d39SAndroid Build Coastguard Worker    * \xrefitem stable "Stable" "Stable List" ICU 2.1
343*0e209d39SAndroid Build Coastguard Worker    */
344*0e209d39SAndroid Build Coastguard Worker   ULOC_ACTUAL_LOCALE    = 0,
345*0e209d39SAndroid Build Coastguard Worker   /** This is the most specific locale supported by ICU
346*0e209d39SAndroid Build Coastguard Worker    * \xrefitem stable "Stable" "Stable List" ICU 2.1
347*0e209d39SAndroid Build Coastguard Worker    */
348*0e209d39SAndroid Build Coastguard Worker   ULOC_VALID_LOCALE    = 1,
349*0e209d39SAndroid Build Coastguard Worker 
350*0e209d39SAndroid Build Coastguard Worker #ifndef U_HIDE_DEPRECATED_API
351*0e209d39SAndroid Build Coastguard Worker   /** This is the requested locale
352*0e209d39SAndroid Build Coastguard Worker    *  \xrefitem deprecated "Deprecated" "Deprecated List" ICU 2.8
353*0e209d39SAndroid Build Coastguard Worker    */
354*0e209d39SAndroid Build Coastguard Worker   ULOC_REQUESTED_LOCALE = 2,
355*0e209d39SAndroid Build Coastguard Worker 
356*0e209d39SAndroid Build Coastguard Worker     /**
357*0e209d39SAndroid Build Coastguard Worker      * One more than the highest normal ULocDataLocaleType value.
358*0e209d39SAndroid Build Coastguard Worker      * \xrefitem deprecated "Deprecated" "Deprecated List" ICU 58 The numeric value may change over time, see ICU ticket #12420.
359*0e209d39SAndroid Build Coastguard Worker      */
360*0e209d39SAndroid Build Coastguard Worker     ULOC_DATA_LOCALE_TYPE_LIMIT = 3
361*0e209d39SAndroid Build Coastguard Worker #endif  // U_HIDE_DEPRECATED_API
362*0e209d39SAndroid Build Coastguard Worker } ULocDataLocaleType;
363*0e209d39SAndroid Build Coastguard Worker 
364*0e209d39SAndroid Build Coastguard Worker #ifndef U_HIDE_SYSTEM_API
365*0e209d39SAndroid Build Coastguard Worker /**
366*0e209d39SAndroid Build Coastguard Worker  * Gets ICU's default locale.
367*0e209d39SAndroid Build Coastguard Worker  * The returned string is a snapshot in time, and will remain valid
368*0e209d39SAndroid Build Coastguard Worker  *   and unchanged even when uloc_setDefault() is called.
369*0e209d39SAndroid Build Coastguard Worker  *   The returned storage is owned by ICU, and must not be altered or deleted
370*0e209d39SAndroid Build Coastguard Worker  *   by the caller.
371*0e209d39SAndroid Build Coastguard Worker  * On Android, uloc_setDefault() is not visible because the default Locale in ICU4C,
372*0e209d39SAndroid Build Coastguard Worker  * ICU4J and java.util.Locale are synchronized. To set a default locale, call
373*0e209d39SAndroid Build Coastguard Worker  * java.util.Locale#setDefault in java or by reverse JNI.
374*0e209d39SAndroid Build Coastguard Worker  *
375*0e209d39SAndroid Build Coastguard Worker  * @return the ICU default locale
376*0e209d39SAndroid Build Coastguard Worker  * \xrefitem system "System" "System List" Do not use unless you know what you are doing.
377*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
378*0e209d39SAndroid Build Coastguard Worker  */
379*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
380*0e209d39SAndroid Build Coastguard Worker uloc_getDefault(void) __INTRODUCED_IN(31);
381*0e209d39SAndroid Build Coastguard Worker 
382*0e209d39SAndroid Build Coastguard Worker 
383*0e209d39SAndroid Build Coastguard Worker 
384*0e209d39SAndroid Build Coastguard Worker 
385*0e209d39SAndroid Build Coastguard Worker #endif  /* U_HIDE_SYSTEM_API */
386*0e209d39SAndroid Build Coastguard Worker 
387*0e209d39SAndroid Build Coastguard Worker /**
388*0e209d39SAndroid Build Coastguard Worker  * Gets the language code for the specified locale.
389*0e209d39SAndroid Build Coastguard Worker  *
390*0e209d39SAndroid Build Coastguard Worker  * This function may return with a failure error code for certain kinds of inputs
391*0e209d39SAndroid Build Coastguard Worker  * but does not fully check for well-formed locale IDs / language tags.
392*0e209d39SAndroid Build Coastguard Worker  *
393*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the ISO language code with
394*0e209d39SAndroid Build Coastguard Worker  * @param language the language code for localeID
395*0e209d39SAndroid Build Coastguard Worker  * @param languageCapacity the size of the language buffer to store the
396*0e209d39SAndroid Build Coastguard Worker  * language code with
397*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the language code failed
398*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the language code.  If it's greater
399*0e209d39SAndroid Build Coastguard Worker  * than languageCapacity, the returned language code will be truncated.
400*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
401*0e209d39SAndroid Build Coastguard Worker  */
402*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
403*0e209d39SAndroid Build Coastguard Worker uloc_getLanguage(const char*    localeID,
404*0e209d39SAndroid Build Coastguard Worker          char* language,
405*0e209d39SAndroid Build Coastguard Worker          int32_t languageCapacity,
406*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
407*0e209d39SAndroid Build Coastguard Worker 
408*0e209d39SAndroid Build Coastguard Worker 
409*0e209d39SAndroid Build Coastguard Worker 
410*0e209d39SAndroid Build Coastguard Worker /**
411*0e209d39SAndroid Build Coastguard Worker  * Gets the script code for the specified locale.
412*0e209d39SAndroid Build Coastguard Worker  *
413*0e209d39SAndroid Build Coastguard Worker  * This function may return with a failure error code for certain kinds of inputs
414*0e209d39SAndroid Build Coastguard Worker  * but does not fully check for well-formed locale IDs / language tags.
415*0e209d39SAndroid Build Coastguard Worker  *
416*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the ISO language code with
417*0e209d39SAndroid Build Coastguard Worker  * @param script the language code for localeID
418*0e209d39SAndroid Build Coastguard Worker  * @param scriptCapacity the size of the language buffer to store the
419*0e209d39SAndroid Build Coastguard Worker  * language code with
420*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the language code failed
421*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the language code.  If it's greater
422*0e209d39SAndroid Build Coastguard Worker  * than scriptCapacity, the returned language code will be truncated.
423*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
424*0e209d39SAndroid Build Coastguard Worker  */
425*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
426*0e209d39SAndroid Build Coastguard Worker uloc_getScript(const char*    localeID,
427*0e209d39SAndroid Build Coastguard Worker          char* script,
428*0e209d39SAndroid Build Coastguard Worker          int32_t scriptCapacity,
429*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
430*0e209d39SAndroid Build Coastguard Worker 
431*0e209d39SAndroid Build Coastguard Worker 
432*0e209d39SAndroid Build Coastguard Worker 
433*0e209d39SAndroid Build Coastguard Worker /**
434*0e209d39SAndroid Build Coastguard Worker  * Gets the  country code for the specified locale.
435*0e209d39SAndroid Build Coastguard Worker  *
436*0e209d39SAndroid Build Coastguard Worker  * This function may return with a failure error code for certain kinds of inputs
437*0e209d39SAndroid Build Coastguard Worker  * but does not fully check for well-formed locale IDs / language tags.
438*0e209d39SAndroid Build Coastguard Worker  *
439*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the country code with
440*0e209d39SAndroid Build Coastguard Worker  * @param country the country code for localeID
441*0e209d39SAndroid Build Coastguard Worker  * @param countryCapacity the size of the country buffer to store the
442*0e209d39SAndroid Build Coastguard Worker  * country code with
443*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the country code failed
444*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the country code.  If it's greater
445*0e209d39SAndroid Build Coastguard Worker  * than countryCapacity, the returned country code will be truncated.
446*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
447*0e209d39SAndroid Build Coastguard Worker  */
448*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
449*0e209d39SAndroid Build Coastguard Worker uloc_getCountry(const char*    localeID,
450*0e209d39SAndroid Build Coastguard Worker         char* country,
451*0e209d39SAndroid Build Coastguard Worker         int32_t countryCapacity,
452*0e209d39SAndroid Build Coastguard Worker         UErrorCode* err) __INTRODUCED_IN(31);
453*0e209d39SAndroid Build Coastguard Worker 
454*0e209d39SAndroid Build Coastguard Worker 
455*0e209d39SAndroid Build Coastguard Worker 
456*0e209d39SAndroid Build Coastguard Worker /**
457*0e209d39SAndroid Build Coastguard Worker  * Gets the variant code for the specified locale.
458*0e209d39SAndroid Build Coastguard Worker  *
459*0e209d39SAndroid Build Coastguard Worker  * This function may return with a failure error code for certain kinds of inputs
460*0e209d39SAndroid Build Coastguard Worker  * but does not fully check for well-formed locale IDs / language tags.
461*0e209d39SAndroid Build Coastguard Worker  *
462*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the variant code with
463*0e209d39SAndroid Build Coastguard Worker  * @param variant the variant code for localeID
464*0e209d39SAndroid Build Coastguard Worker  * @param variantCapacity the size of the variant buffer to store the
465*0e209d39SAndroid Build Coastguard Worker  * variant code with
466*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the variant code failed
467*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the variant code.  If it's greater
468*0e209d39SAndroid Build Coastguard Worker  * than variantCapacity, the returned variant code will be truncated.
469*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
470*0e209d39SAndroid Build Coastguard Worker  */
471*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
472*0e209d39SAndroid Build Coastguard Worker uloc_getVariant(const char*    localeID,
473*0e209d39SAndroid Build Coastguard Worker         char* variant,
474*0e209d39SAndroid Build Coastguard Worker         int32_t variantCapacity,
475*0e209d39SAndroid Build Coastguard Worker         UErrorCode* err) __INTRODUCED_IN(31);
476*0e209d39SAndroid Build Coastguard Worker 
477*0e209d39SAndroid Build Coastguard Worker 
478*0e209d39SAndroid Build Coastguard Worker 
479*0e209d39SAndroid Build Coastguard Worker 
480*0e209d39SAndroid Build Coastguard Worker /**
481*0e209d39SAndroid Build Coastguard Worker  * Gets the full name for the specified locale.
482*0e209d39SAndroid Build Coastguard Worker  *
483*0e209d39SAndroid Build Coastguard Worker  * This function may return with a failure error code for certain kinds of inputs
484*0e209d39SAndroid Build Coastguard Worker  * but does not fully check for well-formed locale IDs / language tags.
485*0e209d39SAndroid Build Coastguard Worker  *
486*0e209d39SAndroid Build Coastguard Worker  * Note: This has the effect of 'canonicalizing' the ICU locale ID to
487*0e209d39SAndroid Build Coastguard Worker  * a certain extent. Upper and lower case are set as needed.
488*0e209d39SAndroid Build Coastguard Worker  * It does NOT map aliased names in any way.
489*0e209d39SAndroid Build Coastguard Worker  * See the top of this header file.
490*0e209d39SAndroid Build Coastguard Worker  * This API supports preflighting.
491*0e209d39SAndroid Build Coastguard Worker  *
492*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the full name with
493*0e209d39SAndroid Build Coastguard Worker  * @param name fill in buffer for the name without keywords.
494*0e209d39SAndroid Build Coastguard Worker  * @param nameCapacity capacity of the fill in buffer.
495*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the full name failed
496*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the full name.  If it's greater
497*0e209d39SAndroid Build Coastguard Worker  * than nameCapacity, the returned full name will be truncated.
498*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
499*0e209d39SAndroid Build Coastguard Worker  */
500*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
501*0e209d39SAndroid Build Coastguard Worker uloc_getName(const char*    localeID,
502*0e209d39SAndroid Build Coastguard Worker          char* name,
503*0e209d39SAndroid Build Coastguard Worker          int32_t nameCapacity,
504*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
505*0e209d39SAndroid Build Coastguard Worker 
506*0e209d39SAndroid Build Coastguard Worker 
507*0e209d39SAndroid Build Coastguard Worker 
508*0e209d39SAndroid Build Coastguard Worker /**
509*0e209d39SAndroid Build Coastguard Worker  * Gets the full name for the specified locale.
510*0e209d39SAndroid Build Coastguard Worker  * Note: This has the effect of 'canonicalizing' the string to
511*0e209d39SAndroid Build Coastguard Worker  * a certain extent. Upper and lower case are set as needed,
512*0e209d39SAndroid Build Coastguard Worker  * and if the components were in 'POSIX' format they are changed to
513*0e209d39SAndroid Build Coastguard Worker  * ICU format.  It does NOT map aliased names in any way.
514*0e209d39SAndroid Build Coastguard Worker  * See the top of this header file.
515*0e209d39SAndroid Build Coastguard Worker  *
516*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the full name with
517*0e209d39SAndroid Build Coastguard Worker  * @param name the full name for localeID
518*0e209d39SAndroid Build Coastguard Worker  * @param nameCapacity the size of the name buffer to store the
519*0e209d39SAndroid Build Coastguard Worker  * full name with
520*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the full name failed
521*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the full name.  If it's greater
522*0e209d39SAndroid Build Coastguard Worker  * than nameCapacity, the returned full name will be truncated.
523*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
524*0e209d39SAndroid Build Coastguard Worker  */
525*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
526*0e209d39SAndroid Build Coastguard Worker uloc_canonicalize(const char*    localeID,
527*0e209d39SAndroid Build Coastguard Worker          char* name,
528*0e209d39SAndroid Build Coastguard Worker          int32_t nameCapacity,
529*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
530*0e209d39SAndroid Build Coastguard Worker 
531*0e209d39SAndroid Build Coastguard Worker 
532*0e209d39SAndroid Build Coastguard Worker 
533*0e209d39SAndroid Build Coastguard Worker /**
534*0e209d39SAndroid Build Coastguard Worker  * Gets the ISO language code for the specified locale.
535*0e209d39SAndroid Build Coastguard Worker  *
536*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the ISO language code with
537*0e209d39SAndroid Build Coastguard Worker  * @return language the ISO language code for localeID
538*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
539*0e209d39SAndroid Build Coastguard Worker  */
540*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
541*0e209d39SAndroid Build Coastguard Worker uloc_getISO3Language(const char* localeID) __INTRODUCED_IN(31);
542*0e209d39SAndroid Build Coastguard Worker 
543*0e209d39SAndroid Build Coastguard Worker 
544*0e209d39SAndroid Build Coastguard Worker 
545*0e209d39SAndroid Build Coastguard Worker 
546*0e209d39SAndroid Build Coastguard Worker /**
547*0e209d39SAndroid Build Coastguard Worker  * Gets the ISO country code for the specified locale.
548*0e209d39SAndroid Build Coastguard Worker  *
549*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the ISO country code with
550*0e209d39SAndroid Build Coastguard Worker  * @return country the ISO country code for localeID
551*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
552*0e209d39SAndroid Build Coastguard Worker  */
553*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
554*0e209d39SAndroid Build Coastguard Worker uloc_getISO3Country(const char* localeID) __INTRODUCED_IN(31);
555*0e209d39SAndroid Build Coastguard Worker 
556*0e209d39SAndroid Build Coastguard Worker 
557*0e209d39SAndroid Build Coastguard Worker 
558*0e209d39SAndroid Build Coastguard Worker 
559*0e209d39SAndroid Build Coastguard Worker 
560*0e209d39SAndroid Build Coastguard Worker /**
561*0e209d39SAndroid Build Coastguard Worker  * Gets the language name suitable for display for the specified locale.
562*0e209d39SAndroid Build Coastguard Worker  *
563*0e209d39SAndroid Build Coastguard Worker  * @param locale the locale to get the ISO language code with
564*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale Specifies the locale to be used to display the name. In
565*0e209d39SAndroid Build Coastguard Worker  *                 other words, if the locale's language code is "en", passing
566*0e209d39SAndroid Build Coastguard Worker  *                 Locale::getFrench() for inLocale would result in "Anglais",
567*0e209d39SAndroid Build Coastguard Worker  *                 while passing Locale::getGerman() for inLocale would result
568*0e209d39SAndroid Build Coastguard Worker  *                 in "Englisch".
569*0e209d39SAndroid Build Coastguard Worker  * @param language the displayable language code for localeID
570*0e209d39SAndroid Build Coastguard Worker  * @param languageCapacity the size of the language buffer to store the
571*0e209d39SAndroid Build Coastguard Worker  *                 displayable language code with.
572*0e209d39SAndroid Build Coastguard Worker  * @param status error information if retrieving the displayable language code
573*0e209d39SAndroid Build Coastguard Worker  *                 failed. U_USING_DEFAULT_WARNING indicates that no data was
574*0e209d39SAndroid Build Coastguard Worker  *                 found from the locale resources and a case canonicalized
575*0e209d39SAndroid Build Coastguard Worker  *                 language code is placed into language as fallback.
576*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable language code. If
577*0e209d39SAndroid Build Coastguard Worker  *                 it's greater than languageCapacity, the returned language
578*0e209d39SAndroid Build Coastguard Worker  *                 code will be truncated.
579*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
580*0e209d39SAndroid Build Coastguard Worker  */
581*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
582*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayLanguage(const char* locale,
583*0e209d39SAndroid Build Coastguard Worker             const char* displayLocale,
584*0e209d39SAndroid Build Coastguard Worker             UChar* language,
585*0e209d39SAndroid Build Coastguard Worker             int32_t languageCapacity,
586*0e209d39SAndroid Build Coastguard Worker             UErrorCode* status) __INTRODUCED_IN(31);
587*0e209d39SAndroid Build Coastguard Worker 
588*0e209d39SAndroid Build Coastguard Worker 
589*0e209d39SAndroid Build Coastguard Worker 
590*0e209d39SAndroid Build Coastguard Worker /**
591*0e209d39SAndroid Build Coastguard Worker  * Gets the script name suitable for display for the specified locale.
592*0e209d39SAndroid Build Coastguard Worker  *
593*0e209d39SAndroid Build Coastguard Worker  * @param locale the locale to get the displayable script code with. NULL may be
594*0e209d39SAndroid Build Coastguard Worker  *                 used to specify the default.
595*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale Specifies the locale to be used to display the name. In
596*0e209d39SAndroid Build Coastguard Worker  *                 other words, if the locale's language code is "en", passing
597*0e209d39SAndroid Build Coastguard Worker  *                 Locale::getFrench() for inLocale would result in "", while
598*0e209d39SAndroid Build Coastguard Worker  *                 passing Locale::getGerman() for inLocale would result in "".
599*0e209d39SAndroid Build Coastguard Worker  *                 NULL may be used to specify the default.
600*0e209d39SAndroid Build Coastguard Worker  * @param script the displayable script for the localeID.
601*0e209d39SAndroid Build Coastguard Worker  * @param scriptCapacity the size of the script buffer to store the displayable
602*0e209d39SAndroid Build Coastguard Worker  *                 script code with.
603*0e209d39SAndroid Build Coastguard Worker  * @param status error information if retrieving the displayable script code
604*0e209d39SAndroid Build Coastguard Worker  *                 failed. U_USING_DEFAULT_WARNING indicates that no data was
605*0e209d39SAndroid Build Coastguard Worker  *                 found from the locale resources and a case canonicalized
606*0e209d39SAndroid Build Coastguard Worker  *                 script code is placed into script as fallback.
607*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable script code. If
608*0e209d39SAndroid Build Coastguard Worker  *                 it's greater than scriptCapacity, the returned displayable
609*0e209d39SAndroid Build Coastguard Worker  *                 script code will be truncated.
610*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
611*0e209d39SAndroid Build Coastguard Worker  */
612*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
613*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayScript(const char* locale,
614*0e209d39SAndroid Build Coastguard Worker             const char* displayLocale,
615*0e209d39SAndroid Build Coastguard Worker             UChar* script,
616*0e209d39SAndroid Build Coastguard Worker             int32_t scriptCapacity,
617*0e209d39SAndroid Build Coastguard Worker             UErrorCode* status) __INTRODUCED_IN(31);
618*0e209d39SAndroid Build Coastguard Worker 
619*0e209d39SAndroid Build Coastguard Worker 
620*0e209d39SAndroid Build Coastguard Worker 
621*0e209d39SAndroid Build Coastguard Worker /**
622*0e209d39SAndroid Build Coastguard Worker  * Gets the country name suitable for display for the specified locale.
623*0e209d39SAndroid Build Coastguard Worker  * Warning: this is for the region part of a valid locale ID; it cannot just be
624*0e209d39SAndroid Build Coastguard Worker  * the region code (like "FR"). To get the display name for a region alone, or
625*0e209d39SAndroid Build Coastguard Worker  * for other options, use ULocaleDisplayNames instead.
626*0e209d39SAndroid Build Coastguard Worker  *
627*0e209d39SAndroid Build Coastguard Worker  * @param locale the locale to get the displayable country code with. NULL may
628*0e209d39SAndroid Build Coastguard Worker  *                 be used to specify the default.
629*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale Specifies the locale to be used to display the name. In
630*0e209d39SAndroid Build Coastguard Worker  *                 other words, if the locale's language code is "en", passing
631*0e209d39SAndroid Build Coastguard Worker  *                 Locale::getFrench() for inLocale would result in "Anglais",
632*0e209d39SAndroid Build Coastguard Worker  *                 while passing Locale::getGerman() for inLocale would result
633*0e209d39SAndroid Build Coastguard Worker  *                 in "Englisch". NULL may be used to specify the default.
634*0e209d39SAndroid Build Coastguard Worker  * @param country the displayable country code for localeID.
635*0e209d39SAndroid Build Coastguard Worker  * @param countryCapacity the size of the country buffer to store the
636*0e209d39SAndroid Build Coastguard Worker  *                 displayable country code with.
637*0e209d39SAndroid Build Coastguard Worker  * @param status error information if retrieving the displayable country code
638*0e209d39SAndroid Build Coastguard Worker  *                 failed. U_USING_DEFAULT_WARNING indicates that no data was
639*0e209d39SAndroid Build Coastguard Worker  *                 found from the locale resources and a case canonicalized
640*0e209d39SAndroid Build Coastguard Worker  *                 country code is placed into country as fallback.
641*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable country code. If
642*0e209d39SAndroid Build Coastguard Worker  *                 it's greater than countryCapacity, the returned displayable
643*0e209d39SAndroid Build Coastguard Worker  *                 country code will be truncated.
644*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
645*0e209d39SAndroid Build Coastguard Worker  */
646*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
647*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayCountry(const char* locale,
648*0e209d39SAndroid Build Coastguard Worker                        const char* displayLocale,
649*0e209d39SAndroid Build Coastguard Worker                        UChar* country,
650*0e209d39SAndroid Build Coastguard Worker                        int32_t countryCapacity,
651*0e209d39SAndroid Build Coastguard Worker                        UErrorCode* status) __INTRODUCED_IN(31);
652*0e209d39SAndroid Build Coastguard Worker 
653*0e209d39SAndroid Build Coastguard Worker 
654*0e209d39SAndroid Build Coastguard Worker 
655*0e209d39SAndroid Build Coastguard Worker 
656*0e209d39SAndroid Build Coastguard Worker /**
657*0e209d39SAndroid Build Coastguard Worker  * Gets the variant name suitable for display for the specified locale.
658*0e209d39SAndroid Build Coastguard Worker  *
659*0e209d39SAndroid Build Coastguard Worker  * @param locale the locale to get the displayable variant code with. NULL may
660*0e209d39SAndroid Build Coastguard Worker  *                 be used to specify the default.
661*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale Specifies the locale to be used to display the name. In
662*0e209d39SAndroid Build Coastguard Worker  *                 other words, if the locale's language code is "en", passing
663*0e209d39SAndroid Build Coastguard Worker  *                 Locale::getFrench() for inLocale would result in "Anglais",
664*0e209d39SAndroid Build Coastguard Worker  *                 while passing Locale::getGerman() for inLocale would result
665*0e209d39SAndroid Build Coastguard Worker  *                 in "Englisch". NULL may be used to specify the default.
666*0e209d39SAndroid Build Coastguard Worker  * @param variant the displayable variant code for localeID.
667*0e209d39SAndroid Build Coastguard Worker  * @param variantCapacity the size of the variant buffer to store the
668*0e209d39SAndroid Build Coastguard Worker  *                 displayable variant code with.
669*0e209d39SAndroid Build Coastguard Worker  * @param status error information if retrieving the displayable variant code
670*0e209d39SAndroid Build Coastguard Worker  *                 failed. U_USING_DEFAULT_WARNING indicates that no data was
671*0e209d39SAndroid Build Coastguard Worker  *                 found from the locale resources and a case canonicalized
672*0e209d39SAndroid Build Coastguard Worker  *                 variant code is placed into variant as fallback.
673*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable variant code. If
674*0e209d39SAndroid Build Coastguard Worker  *                 it's greater than variantCapacity, the returned displayable
675*0e209d39SAndroid Build Coastguard Worker  *                 variant code will be truncated.
676*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
677*0e209d39SAndroid Build Coastguard Worker  */
678*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
679*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayVariant(const char* locale,
680*0e209d39SAndroid Build Coastguard Worker                        const char* displayLocale,
681*0e209d39SAndroid Build Coastguard Worker                        UChar* variant,
682*0e209d39SAndroid Build Coastguard Worker                        int32_t variantCapacity,
683*0e209d39SAndroid Build Coastguard Worker                        UErrorCode* status) __INTRODUCED_IN(31);
684*0e209d39SAndroid Build Coastguard Worker 
685*0e209d39SAndroid Build Coastguard Worker 
686*0e209d39SAndroid Build Coastguard Worker 
687*0e209d39SAndroid Build Coastguard Worker /**
688*0e209d39SAndroid Build Coastguard Worker  * Gets the keyword name suitable for display for the specified locale. E.g:
689*0e209d39SAndroid Build Coastguard Worker  * for the locale string de_DE\@collation=PHONEBOOK, this API gets the display
690*0e209d39SAndroid Build Coastguard Worker  * string for the keyword collation.
691*0e209d39SAndroid Build Coastguard Worker  * Usage:
692*0e209d39SAndroid Build Coastguard Worker  * <code>
693*0e209d39SAndroid Build Coastguard Worker  *    UErrorCode status = U_ZERO_ERROR;
694*0e209d39SAndroid Build Coastguard Worker  *    const char* keyword =NULL;
695*0e209d39SAndroid Build Coastguard Worker  *    int32_t keywordLen = 0;
696*0e209d39SAndroid Build Coastguard Worker  *    int32_t keywordCount = 0;
697*0e209d39SAndroid Build Coastguard Worker  *    UChar displayKeyword[256];
698*0e209d39SAndroid Build Coastguard Worker  *    int32_t displayKeywordLen = 0;
699*0e209d39SAndroid Build Coastguard Worker  *    UEnumeration* keywordEnum = uloc_openKeywords("de_DE@collation=PHONEBOOK;calendar=TRADITIONAL", &status);
700*0e209d39SAndroid Build Coastguard Worker  *    for(keywordCount = uenum_count(keywordEnum, &status); keywordCount > 0 ; keywordCount--){
701*0e209d39SAndroid Build Coastguard Worker  *          if(U_FAILURE(status)){
702*0e209d39SAndroid Build Coastguard Worker  *              ...something went wrong so handle the error...
703*0e209d39SAndroid Build Coastguard Worker  *              break;
704*0e209d39SAndroid Build Coastguard Worker  *          }
705*0e209d39SAndroid Build Coastguard Worker  *          // the uenum_next returns NUL terminated string
706*0e209d39SAndroid Build Coastguard Worker  *          keyword = uenum_next(keywordEnum, &keywordLen, &status);
707*0e209d39SAndroid Build Coastguard Worker  *          displayKeywordLen = uloc_getDisplayKeyword(keyword, "en_US", displayKeyword, 256);
708*0e209d39SAndroid Build Coastguard Worker  *          ... do something interesting .....
709*0e209d39SAndroid Build Coastguard Worker  *    }
710*0e209d39SAndroid Build Coastguard Worker  *    uenum_close(keywordEnum);
711*0e209d39SAndroid Build Coastguard Worker  * </code>
712*0e209d39SAndroid Build Coastguard Worker  * @param keyword           The keyword whose display string needs to be returned.
713*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale     Specifies the locale to be used to display the name.  In other words,
714*0e209d39SAndroid Build Coastguard Worker  *                          if the locale's language code is "en", passing Locale::getFrench() for
715*0e209d39SAndroid Build Coastguard Worker  *                          inLocale would result in "Anglais", while passing Locale::getGerman()
716*0e209d39SAndroid Build Coastguard Worker  *                          for inLocale would result in "Englisch". NULL may be used to specify the default.
717*0e209d39SAndroid Build Coastguard Worker  * @param dest              the buffer to which the displayable keyword should be written.
718*0e209d39SAndroid Build Coastguard Worker  * @param destCapacity      The size of the buffer (number of UChars). If it is 0, then
719*0e209d39SAndroid Build Coastguard Worker  *                          dest may be NULL and the function will only return the length of the
720*0e209d39SAndroid Build Coastguard Worker  *                          result without writing any of the result string (pre-flighting).
721*0e209d39SAndroid Build Coastguard Worker  * @param status            error information if retrieving the displayable string failed.
722*0e209d39SAndroid Build Coastguard Worker  *                          Should not be NULL and should not indicate failure on entry.
723*0e209d39SAndroid Build Coastguard Worker  *                          U_USING_DEFAULT_WARNING indicates that no data was found from the locale
724*0e209d39SAndroid Build Coastguard Worker  *                          resources and the keyword is placed into dest as fallback.
725*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable variant code.
726*0e209d39SAndroid Build Coastguard Worker  * @see #uloc_openKeywords
727*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
728*0e209d39SAndroid Build Coastguard Worker  */
729*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
730*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayKeyword(const char* keyword,
731*0e209d39SAndroid Build Coastguard Worker                        const char* displayLocale,
732*0e209d39SAndroid Build Coastguard Worker                        UChar* dest,
733*0e209d39SAndroid Build Coastguard Worker                        int32_t destCapacity,
734*0e209d39SAndroid Build Coastguard Worker                        UErrorCode* status) __INTRODUCED_IN(31);
735*0e209d39SAndroid Build Coastguard Worker 
736*0e209d39SAndroid Build Coastguard Worker 
737*0e209d39SAndroid Build Coastguard Worker /**
738*0e209d39SAndroid Build Coastguard Worker  * Gets the value of the keyword suitable for display for the specified locale.
739*0e209d39SAndroid Build Coastguard Worker  * E.g: for the locale string de_DE\@collation=PHONEBOOK, this API gets the display
740*0e209d39SAndroid Build Coastguard Worker  * string for PHONEBOOK, in the display locale, when "collation" is specified as the keyword.
741*0e209d39SAndroid Build Coastguard Worker  *
742*0e209d39SAndroid Build Coastguard Worker  * @param locale            The locale to get the displayable variant code with. NULL may be used to specify the default.
743*0e209d39SAndroid Build Coastguard Worker  * @param keyword           The keyword for whose value should be used.
744*0e209d39SAndroid Build Coastguard Worker  * @param displayLocale     Specifies the locale to be used to display the name.  In other words,
745*0e209d39SAndroid Build Coastguard Worker  *                          if the locale's language code is "en", passing Locale::getFrench() for
746*0e209d39SAndroid Build Coastguard Worker  *                          inLocale would result in "Anglais", while passing Locale::getGerman()
747*0e209d39SAndroid Build Coastguard Worker  *                          for inLocale would result in "Englisch". NULL may be used to specify the default.
748*0e209d39SAndroid Build Coastguard Worker  * @param dest              the buffer to which the displayable keyword should be written.
749*0e209d39SAndroid Build Coastguard Worker  * @param destCapacity      The size of the buffer (number of UChars). If it is 0, then
750*0e209d39SAndroid Build Coastguard Worker  *                          dest may be NULL and the function will only return the length of the
751*0e209d39SAndroid Build Coastguard Worker  *                          result without writing any of the result string (pre-flighting).
752*0e209d39SAndroid Build Coastguard Worker  * @param status            error information if retrieving the displayable string failed.
753*0e209d39SAndroid Build Coastguard Worker  *                          Should not be NULL and must not indicate failure on entry.
754*0e209d39SAndroid Build Coastguard Worker  *                          U_USING_DEFAULT_WARNING indicates that no data was found from the locale
755*0e209d39SAndroid Build Coastguard Worker  *                          resources and the value of the keyword is placed into dest as fallback.
756*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable variant code.
757*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
758*0e209d39SAndroid Build Coastguard Worker  */
759*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
760*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayKeywordValue(   const char* locale,
761*0e209d39SAndroid Build Coastguard Worker                                const char* keyword,
762*0e209d39SAndroid Build Coastguard Worker                                const char* displayLocale,
763*0e209d39SAndroid Build Coastguard Worker                                UChar* dest,
764*0e209d39SAndroid Build Coastguard Worker                                int32_t destCapacity,
765*0e209d39SAndroid Build Coastguard Worker                                UErrorCode* status) __INTRODUCED_IN(31);
766*0e209d39SAndroid Build Coastguard Worker 
767*0e209d39SAndroid Build Coastguard Worker 
768*0e209d39SAndroid Build Coastguard Worker /**
769*0e209d39SAndroid Build Coastguard Worker  * Gets the full name suitable for display for the specified locale.
770*0e209d39SAndroid Build Coastguard Worker  *
771*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the displayable name with. NULL may be used to specify the default.
772*0e209d39SAndroid Build Coastguard Worker  * @param inLocaleID Specifies the locale to be used to display the name.  In other words,
773*0e209d39SAndroid Build Coastguard Worker  *                   if the locale's language code is "en", passing Locale::getFrench() for
774*0e209d39SAndroid Build Coastguard Worker  *                   inLocale would result in "Anglais", while passing Locale::getGerman()
775*0e209d39SAndroid Build Coastguard Worker  *                   for inLocale would result in "Englisch". NULL may be used to specify the default.
776*0e209d39SAndroid Build Coastguard Worker  * @param result the displayable name for localeID
777*0e209d39SAndroid Build Coastguard Worker  * @param maxResultSize the size of the name buffer to store the
778*0e209d39SAndroid Build Coastguard Worker  * displayable full name with
779*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the displayable name failed
780*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the displayable name.  If it's greater
781*0e209d39SAndroid Build Coastguard Worker  * than maxResultSize, the returned displayable name will be truncated.
782*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
783*0e209d39SAndroid Build Coastguard Worker  */
784*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
785*0e209d39SAndroid Build Coastguard Worker uloc_getDisplayName(const char* localeID,
786*0e209d39SAndroid Build Coastguard Worker             const char* inLocaleID,
787*0e209d39SAndroid Build Coastguard Worker             UChar* result,
788*0e209d39SAndroid Build Coastguard Worker             int32_t maxResultSize,
789*0e209d39SAndroid Build Coastguard Worker             UErrorCode* err) __INTRODUCED_IN(31);
790*0e209d39SAndroid Build Coastguard Worker 
791*0e209d39SAndroid Build Coastguard Worker 
792*0e209d39SAndroid Build Coastguard Worker 
793*0e209d39SAndroid Build Coastguard Worker 
794*0e209d39SAndroid Build Coastguard Worker /**
795*0e209d39SAndroid Build Coastguard Worker  * Gets the specified locale from a list of available locales.
796*0e209d39SAndroid Build Coastguard Worker  *
797*0e209d39SAndroid Build Coastguard Worker  * This method corresponds to uloc_openAvailableByType called with the
798*0e209d39SAndroid Build Coastguard Worker  * ULOC_AVAILABLE_DEFAULT type argument.
799*0e209d39SAndroid Build Coastguard Worker  *
800*0e209d39SAndroid Build Coastguard Worker  * The return value is a pointer to an item of a locale name array. Both this
801*0e209d39SAndroid Build Coastguard Worker  * array and the pointers it contains are owned by ICU and should not be
802*0e209d39SAndroid Build Coastguard Worker  * deleted or written through by the caller. The locale name is terminated by
803*0e209d39SAndroid Build Coastguard Worker  * a null pointer.
804*0e209d39SAndroid Build Coastguard Worker  *
805*0e209d39SAndroid Build Coastguard Worker  * @param n the specific locale name index of the available locale list;
806*0e209d39SAndroid Build Coastguard Worker  *     should not exceed the number returned by uloc_countAvailable.
807*0e209d39SAndroid Build Coastguard Worker  * @return a specified locale name of all available locales
808*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
809*0e209d39SAndroid Build Coastguard Worker  */
810*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
811*0e209d39SAndroid Build Coastguard Worker uloc_getAvailable(int32_t n) __INTRODUCED_IN(31);
812*0e209d39SAndroid Build Coastguard Worker 
813*0e209d39SAndroid Build Coastguard Worker 
814*0e209d39SAndroid Build Coastguard Worker 
815*0e209d39SAndroid Build Coastguard Worker /**
816*0e209d39SAndroid Build Coastguard Worker  * Gets the size of the all available locale list.
817*0e209d39SAndroid Build Coastguard Worker  *
818*0e209d39SAndroid Build Coastguard Worker  * @return the size of the locale list
819*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
820*0e209d39SAndroid Build Coastguard Worker  */
821*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2 uloc_countAvailable(void) __INTRODUCED_IN(31);
822*0e209d39SAndroid Build Coastguard Worker 
823*0e209d39SAndroid Build Coastguard Worker 
824*0e209d39SAndroid Build Coastguard Worker 
825*0e209d39SAndroid Build Coastguard Worker /**
826*0e209d39SAndroid Build Coastguard Worker  * Types for uloc_getAvailableByType and uloc_countAvailableByType.
827*0e209d39SAndroid Build Coastguard Worker  *
828*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 65
829*0e209d39SAndroid Build Coastguard Worker  */
830*0e209d39SAndroid Build Coastguard Worker typedef enum ULocAvailableType {
831*0e209d39SAndroid Build Coastguard Worker   /**
832*0e209d39SAndroid Build Coastguard Worker    * Locales that return data when passed to ICU APIs,
833*0e209d39SAndroid Build Coastguard Worker    * but not including legacy or alias locales.
834*0e209d39SAndroid Build Coastguard Worker    *
835*0e209d39SAndroid Build Coastguard Worker    * \xrefitem stable "Stable" "Stable List" ICU 65
836*0e209d39SAndroid Build Coastguard Worker    */
837*0e209d39SAndroid Build Coastguard Worker   ULOC_AVAILABLE_DEFAULT,
838*0e209d39SAndroid Build Coastguard Worker 
839*0e209d39SAndroid Build Coastguard Worker   /**
840*0e209d39SAndroid Build Coastguard Worker    * Legacy or alias locales that return data when passed to ICU APIs.
841*0e209d39SAndroid Build Coastguard Worker    * Examples of supported legacy or alias locales:
842*0e209d39SAndroid Build Coastguard Worker    *
843*0e209d39SAndroid Build Coastguard Worker    * - iw (alias to he)
844*0e209d39SAndroid Build Coastguard Worker    * - mo (alias to ro)
845*0e209d39SAndroid Build Coastguard Worker    * - zh_CN (alias to zh_Hans_CN)
846*0e209d39SAndroid Build Coastguard Worker    * - sr_BA (alias to sr_Cyrl_BA)
847*0e209d39SAndroid Build Coastguard Worker    * - ars (alias to ar_SA)
848*0e209d39SAndroid Build Coastguard Worker    *
849*0e209d39SAndroid Build Coastguard Worker    * The locales in this set are disjoint from the ones in
850*0e209d39SAndroid Build Coastguard Worker    * ULOC_AVAILABLE_DEFAULT. To get both sets at the same time, use
851*0e209d39SAndroid Build Coastguard Worker    * ULOC_AVAILABLE_WITH_LEGACY_ALIASES.
852*0e209d39SAndroid Build Coastguard Worker    *
853*0e209d39SAndroid Build Coastguard Worker    * \xrefitem stable "Stable" "Stable List" ICU 65
854*0e209d39SAndroid Build Coastguard Worker    */
855*0e209d39SAndroid Build Coastguard Worker   ULOC_AVAILABLE_ONLY_LEGACY_ALIASES,
856*0e209d39SAndroid Build Coastguard Worker 
857*0e209d39SAndroid Build Coastguard Worker   /**
858*0e209d39SAndroid Build Coastguard Worker    * The union of the locales in ULOC_AVAILABLE_DEFAULT and
859*0e209d39SAndroid Build Coastguard Worker    * ULOC_AVAILABLE_ONLY_LEGACY_ALIAS.
860*0e209d39SAndroid Build Coastguard Worker    *
861*0e209d39SAndroid Build Coastguard Worker    * \xrefitem stable "Stable" "Stable List" ICU 65
862*0e209d39SAndroid Build Coastguard Worker    */
863*0e209d39SAndroid Build Coastguard Worker   ULOC_AVAILABLE_WITH_LEGACY_ALIASES,
864*0e209d39SAndroid Build Coastguard Worker 
865*0e209d39SAndroid Build Coastguard Worker #ifndef U_HIDE_INTERNAL_API
866*0e209d39SAndroid Build Coastguard Worker   /**
867*0e209d39SAndroid Build Coastguard Worker    * \xrefitem internal "Internal"  "Internal List"  Do not use. This API is for internal use only.
868*0e209d39SAndroid Build Coastguard Worker    */
869*0e209d39SAndroid Build Coastguard Worker   ULOC_AVAILABLE_COUNT
870*0e209d39SAndroid Build Coastguard Worker #endif  /* U_HIDE_INTERNAL_API */
871*0e209d39SAndroid Build Coastguard Worker } ULocAvailableType;
872*0e209d39SAndroid Build Coastguard Worker 
873*0e209d39SAndroid Build Coastguard Worker 
874*0e209d39SAndroid Build Coastguard Worker 
875*0e209d39SAndroid Build Coastguard Worker /**
876*0e209d39SAndroid Build Coastguard Worker  *
877*0e209d39SAndroid Build Coastguard Worker  * Gets a list of all available 2-letter language codes defined in ISO 639,
878*0e209d39SAndroid Build Coastguard Worker  * plus additional 3-letter codes determined to be useful for locale generation as
879*0e209d39SAndroid Build Coastguard Worker  * defined by Unicode CLDR. This is a pointer
880*0e209d39SAndroid Build Coastguard Worker  * to an array of pointers to arrays of char.  All of these pointers are owned
881*0e209d39SAndroid Build Coastguard Worker  * by ICU-- do not delete them, and do not write through them.  The array is
882*0e209d39SAndroid Build Coastguard Worker  * terminated with a null pointer.
883*0e209d39SAndroid Build Coastguard Worker  * @return a list of all available language codes
884*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
885*0e209d39SAndroid Build Coastguard Worker  */
886*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* const* U_EXPORT2
887*0e209d39SAndroid Build Coastguard Worker uloc_getISOLanguages(void) __INTRODUCED_IN(31);
888*0e209d39SAndroid Build Coastguard Worker 
889*0e209d39SAndroid Build Coastguard Worker 
890*0e209d39SAndroid Build Coastguard Worker 
891*0e209d39SAndroid Build Coastguard Worker /**
892*0e209d39SAndroid Build Coastguard Worker  *
893*0e209d39SAndroid Build Coastguard Worker  * Gets a list of all available 2-letter country codes defined in ISO 639.  This is a
894*0e209d39SAndroid Build Coastguard Worker  * pointer to an array of pointers to arrays of char.  All of these pointers are
895*0e209d39SAndroid Build Coastguard Worker  * owned by ICU-- do not delete them, and do not write through them.  The array is
896*0e209d39SAndroid Build Coastguard Worker  * terminated with a null pointer.
897*0e209d39SAndroid Build Coastguard Worker  * @return a list of all available country codes
898*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.0
899*0e209d39SAndroid Build Coastguard Worker  */
900*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* const* U_EXPORT2
901*0e209d39SAndroid Build Coastguard Worker uloc_getISOCountries(void) __INTRODUCED_IN(31);
902*0e209d39SAndroid Build Coastguard Worker 
903*0e209d39SAndroid Build Coastguard Worker 
904*0e209d39SAndroid Build Coastguard Worker 
905*0e209d39SAndroid Build Coastguard Worker 
906*0e209d39SAndroid Build Coastguard Worker 
907*0e209d39SAndroid Build Coastguard Worker 
908*0e209d39SAndroid Build Coastguard Worker 
909*0e209d39SAndroid Build Coastguard Worker 
910*0e209d39SAndroid Build Coastguard Worker /**
911*0e209d39SAndroid Build Coastguard Worker  * Gets the full name for the specified locale, like uloc_getName(),
912*0e209d39SAndroid Build Coastguard Worker  * but without keywords.
913*0e209d39SAndroid Build Coastguard Worker  *
914*0e209d39SAndroid Build Coastguard Worker  * Note: This has the effect of 'canonicalizing' the string to
915*0e209d39SAndroid Build Coastguard Worker  * a certain extent. Upper and lower case are set as needed,
916*0e209d39SAndroid Build Coastguard Worker  * and if the components were in 'POSIX' format they are changed to
917*0e209d39SAndroid Build Coastguard Worker  * ICU format.  It does NOT map aliased names in any way.
918*0e209d39SAndroid Build Coastguard Worker  * See the top of this header file.
919*0e209d39SAndroid Build Coastguard Worker  *
920*0e209d39SAndroid Build Coastguard Worker  * This API strips off the keyword part, so "de_DE\@collation=phonebook"
921*0e209d39SAndroid Build Coastguard Worker  * will become "de_DE".
922*0e209d39SAndroid Build Coastguard Worker  * This API supports preflighting.
923*0e209d39SAndroid Build Coastguard Worker  *
924*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the full name with
925*0e209d39SAndroid Build Coastguard Worker  * @param name fill in buffer for the name without keywords.
926*0e209d39SAndroid Build Coastguard Worker  * @param nameCapacity capacity of the fill in buffer.
927*0e209d39SAndroid Build Coastguard Worker  * @param err error information if retrieving the full name failed
928*0e209d39SAndroid Build Coastguard Worker  * @return the actual buffer size needed for the full name.  If it's greater
929*0e209d39SAndroid Build Coastguard Worker  * than nameCapacity, the returned full name will be truncated.
930*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
931*0e209d39SAndroid Build Coastguard Worker  */
932*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
933*0e209d39SAndroid Build Coastguard Worker uloc_getBaseName(const char*    localeID,
934*0e209d39SAndroid Build Coastguard Worker          char* name,
935*0e209d39SAndroid Build Coastguard Worker          int32_t nameCapacity,
936*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
937*0e209d39SAndroid Build Coastguard Worker 
938*0e209d39SAndroid Build Coastguard Worker 
939*0e209d39SAndroid Build Coastguard Worker 
940*0e209d39SAndroid Build Coastguard Worker /**
941*0e209d39SAndroid Build Coastguard Worker  * Gets an enumeration of keywords for the specified locale. Enumeration
942*0e209d39SAndroid Build Coastguard Worker  * must get disposed of by the client using uenum_close function.
943*0e209d39SAndroid Build Coastguard Worker  *
944*0e209d39SAndroid Build Coastguard Worker  * @param localeID the locale to get the variant code with
945*0e209d39SAndroid Build Coastguard Worker  * @param status error information if retrieving the keywords failed
946*0e209d39SAndroid Build Coastguard Worker  * @return enumeration of keywords or NULL if there are no keywords.
947*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
948*0e209d39SAndroid Build Coastguard Worker  */
949*0e209d39SAndroid Build Coastguard Worker U_CAPI UEnumeration* U_EXPORT2
950*0e209d39SAndroid Build Coastguard Worker uloc_openKeywords(const char* localeID,
951*0e209d39SAndroid Build Coastguard Worker                         UErrorCode* status) __INTRODUCED_IN(31);
952*0e209d39SAndroid Build Coastguard Worker 
953*0e209d39SAndroid Build Coastguard Worker 
954*0e209d39SAndroid Build Coastguard Worker 
955*0e209d39SAndroid Build Coastguard Worker /**
956*0e209d39SAndroid Build Coastguard Worker  * Get the value for a keyword. Locale name does not need to be normalized.
957*0e209d39SAndroid Build Coastguard Worker  *
958*0e209d39SAndroid Build Coastguard Worker  * @param localeID locale name containing the keyword ("de_DE@currency=EURO;collation=PHONEBOOK")
959*0e209d39SAndroid Build Coastguard Worker  * @param keywordName name of the keyword for which we want the value; must not be
960*0e209d39SAndroid Build Coastguard Worker  *  NULL or empty, and must consist only of [A-Za-z0-9]. Case insensitive.
961*0e209d39SAndroid Build Coastguard Worker  * @param buffer receiving buffer
962*0e209d39SAndroid Build Coastguard Worker  * @param bufferCapacity capacity of receiving buffer
963*0e209d39SAndroid Build Coastguard Worker  * @param status containing error code: e.g. buffer not big enough or ill-formed localeID
964*0e209d39SAndroid Build Coastguard Worker  *  or keywordName parameters.
965*0e209d39SAndroid Build Coastguard Worker  * @return the length of keyword value
966*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 2.8
967*0e209d39SAndroid Build Coastguard Worker  */
968*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
969*0e209d39SAndroid Build Coastguard Worker uloc_getKeywordValue(const char* localeID,
970*0e209d39SAndroid Build Coastguard Worker                      const char* keywordName,
971*0e209d39SAndroid Build Coastguard Worker                      char* buffer, int32_t bufferCapacity,
972*0e209d39SAndroid Build Coastguard Worker                      UErrorCode* status) __INTRODUCED_IN(31);
973*0e209d39SAndroid Build Coastguard Worker 
974*0e209d39SAndroid Build Coastguard Worker 
975*0e209d39SAndroid Build Coastguard Worker 
976*0e209d39SAndroid Build Coastguard Worker 
977*0e209d39SAndroid Build Coastguard Worker /**
978*0e209d39SAndroid Build Coastguard Worker  * Sets or removes the value of the specified keyword.
979*0e209d39SAndroid Build Coastguard Worker  *
980*0e209d39SAndroid Build Coastguard Worker  * For removing all keywords, use uloc_getBaseName().
981*0e209d39SAndroid Build Coastguard Worker  *
982*0e209d39SAndroid Build Coastguard Worker  * NOTE: Unlike almost every other ICU function which takes a
983*0e209d39SAndroid Build Coastguard Worker  * buffer, this function will NOT truncate the output text, and will
984*0e209d39SAndroid Build Coastguard Worker  * not update the buffer with unterminated text setting a status of
985*0e209d39SAndroid Build Coastguard Worker  * U_STRING_NOT_TERMINATED_WARNING. If a BUFFER_OVERFLOW_ERROR is received,
986*0e209d39SAndroid Build Coastguard Worker  * it means a terminated version of the updated locale ID would not fit
987*0e209d39SAndroid Build Coastguard Worker  * in the buffer, and the original buffer is untouched. This is done to
988*0e209d39SAndroid Build Coastguard Worker  * prevent incorrect or possibly even malformed locales from being generated
989*0e209d39SAndroid Build Coastguard Worker  * and used.
990*0e209d39SAndroid Build Coastguard Worker  *
991*0e209d39SAndroid Build Coastguard Worker  * @param keywordName name of the keyword to be set; must not be
992*0e209d39SAndroid Build Coastguard Worker  *  NULL or empty, and must consist only of [A-Za-z0-9]. Case insensitive.
993*0e209d39SAndroid Build Coastguard Worker  * @param keywordValue value of the keyword to be set. If 0-length or
994*0e209d39SAndroid Build Coastguard Worker  *  NULL, will result in the keyword being removed; no error is given if
995*0e209d39SAndroid Build Coastguard Worker  *  that keyword does not exist. Otherwise, must consist only of
996*0e209d39SAndroid Build Coastguard Worker  *  [A-Za-z0-9] and [/_+-].
997*0e209d39SAndroid Build Coastguard Worker  * @param buffer input buffer containing well-formed locale ID to be
998*0e209d39SAndroid Build Coastguard Worker  *  modified.
999*0e209d39SAndroid Build Coastguard Worker  * @param bufferCapacity capacity of receiving buffer
1000*0e209d39SAndroid Build Coastguard Worker  * @param status containing error code: e.g. buffer not big enough
1001*0e209d39SAndroid Build Coastguard Worker  *  or ill-formed keywordName or keywordValue parameters, or ill-formed
1002*0e209d39SAndroid Build Coastguard Worker  *  locale ID in buffer on input.
1003*0e209d39SAndroid Build Coastguard Worker  * @return the length needed for the buffer
1004*0e209d39SAndroid Build Coastguard Worker  * @see uloc_getKeywordValue
1005*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 3.2
1006*0e209d39SAndroid Build Coastguard Worker  */
1007*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1008*0e209d39SAndroid Build Coastguard Worker uloc_setKeywordValue(const char* keywordName,
1009*0e209d39SAndroid Build Coastguard Worker                      const char* keywordValue,
1010*0e209d39SAndroid Build Coastguard Worker                      char* buffer, int32_t bufferCapacity,
1011*0e209d39SAndroid Build Coastguard Worker                      UErrorCode* status) __INTRODUCED_IN(31);
1012*0e209d39SAndroid Build Coastguard Worker 
1013*0e209d39SAndroid Build Coastguard Worker 
1014*0e209d39SAndroid Build Coastguard Worker 
1015*0e209d39SAndroid Build Coastguard Worker /**
1016*0e209d39SAndroid Build Coastguard Worker  * Returns whether the locale's script is written right-to-left.
1017*0e209d39SAndroid Build Coastguard Worker  * If there is no script subtag, then the likely script is used, see uloc_addLikelySubtags().
1018*0e209d39SAndroid Build Coastguard Worker  * If no likely script is known, then false is returned.
1019*0e209d39SAndroid Build Coastguard Worker  *
1020*0e209d39SAndroid Build Coastguard Worker  * A script is right-to-left according to the CLDR script metadata
1021*0e209d39SAndroid Build Coastguard Worker  * which corresponds to whether the script's letters have Bidi_Class=R or AL.
1022*0e209d39SAndroid Build Coastguard Worker  *
1023*0e209d39SAndroid Build Coastguard Worker  * Returns true for "ar" and "en-Hebr", false for "zh" and "fa-Cyrl".
1024*0e209d39SAndroid Build Coastguard Worker  *
1025*0e209d39SAndroid Build Coastguard Worker  * @param locale input locale ID
1026*0e209d39SAndroid Build Coastguard Worker  * @return true if the locale's script is written right-to-left
1027*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 54
1028*0e209d39SAndroid Build Coastguard Worker  */
1029*0e209d39SAndroid Build Coastguard Worker U_CAPI UBool U_EXPORT2
1030*0e209d39SAndroid Build Coastguard Worker uloc_isRightToLeft(const char *locale) __INTRODUCED_IN(31);
1031*0e209d39SAndroid Build Coastguard Worker 
1032*0e209d39SAndroid Build Coastguard Worker 
1033*0e209d39SAndroid Build Coastguard Worker 
1034*0e209d39SAndroid Build Coastguard Worker /**
1035*0e209d39SAndroid Build Coastguard Worker  * enums for the  return value for the character and line orientation
1036*0e209d39SAndroid Build Coastguard Worker  * functions.
1037*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.0
1038*0e209d39SAndroid Build Coastguard Worker  */
1039*0e209d39SAndroid Build Coastguard Worker typedef enum {
1040*0e209d39SAndroid Build Coastguard Worker   ULOC_LAYOUT_LTR   = 0,  /* left-to-right. */
1041*0e209d39SAndroid Build Coastguard Worker   ULOC_LAYOUT_RTL    = 1,  /* right-to-left. */
1042*0e209d39SAndroid Build Coastguard Worker   ULOC_LAYOUT_TTB    = 2,  /* top-to-bottom. */
1043*0e209d39SAndroid Build Coastguard Worker   ULOC_LAYOUT_BTT    = 3,   /* bottom-to-top. */
1044*0e209d39SAndroid Build Coastguard Worker   ULOC_LAYOUT_UNKNOWN
1045*0e209d39SAndroid Build Coastguard Worker } ULayoutType;
1046*0e209d39SAndroid Build Coastguard Worker 
1047*0e209d39SAndroid Build Coastguard Worker /**
1048*0e209d39SAndroid Build Coastguard Worker  * Get the layout character orientation for the specified locale.
1049*0e209d39SAndroid Build Coastguard Worker  *
1050*0e209d39SAndroid Build Coastguard Worker  * @param localeId locale name
1051*0e209d39SAndroid Build Coastguard Worker  * @param status Error status
1052*0e209d39SAndroid Build Coastguard Worker  * @return an enum indicating the layout orientation for characters.
1053*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.0
1054*0e209d39SAndroid Build Coastguard Worker  */
1055*0e209d39SAndroid Build Coastguard Worker U_CAPI ULayoutType U_EXPORT2
1056*0e209d39SAndroid Build Coastguard Worker uloc_getCharacterOrientation(const char* localeId,
1057*0e209d39SAndroid Build Coastguard Worker                              UErrorCode *status) __INTRODUCED_IN(31);
1058*0e209d39SAndroid Build Coastguard Worker 
1059*0e209d39SAndroid Build Coastguard Worker 
1060*0e209d39SAndroid Build Coastguard Worker 
1061*0e209d39SAndroid Build Coastguard Worker /**
1062*0e209d39SAndroid Build Coastguard Worker  * Get the layout line orientation for the specified locale.
1063*0e209d39SAndroid Build Coastguard Worker  *
1064*0e209d39SAndroid Build Coastguard Worker  * @param localeId locale name
1065*0e209d39SAndroid Build Coastguard Worker  * @param status Error status
1066*0e209d39SAndroid Build Coastguard Worker  * @return an enum indicating the layout orientation for lines.
1067*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.0
1068*0e209d39SAndroid Build Coastguard Worker  */
1069*0e209d39SAndroid Build Coastguard Worker U_CAPI ULayoutType U_EXPORT2
1070*0e209d39SAndroid Build Coastguard Worker uloc_getLineOrientation(const char* localeId,
1071*0e209d39SAndroid Build Coastguard Worker                         UErrorCode *status) __INTRODUCED_IN(31);
1072*0e209d39SAndroid Build Coastguard Worker 
1073*0e209d39SAndroid Build Coastguard Worker 
1074*0e209d39SAndroid Build Coastguard Worker 
1075*0e209d39SAndroid Build Coastguard Worker /**
1076*0e209d39SAndroid Build Coastguard Worker  * Output values which uloc_acceptLanguage() writes to the 'outResult' parameter.
1077*0e209d39SAndroid Build Coastguard Worker  *
1078*0e209d39SAndroid Build Coastguard Worker  * @see uloc_acceptLanguageFromHTTP
1079*0e209d39SAndroid Build Coastguard Worker  * @see uloc_acceptLanguage
1080*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 3.2
1081*0e209d39SAndroid Build Coastguard Worker  */
1082*0e209d39SAndroid Build Coastguard Worker typedef enum {
1083*0e209d39SAndroid Build Coastguard Worker     /**
1084*0e209d39SAndroid Build Coastguard Worker      * No exact match was found.
1085*0e209d39SAndroid Build Coastguard Worker      * \xrefitem stable "Stable" "Stable List" ICU 3.2
1086*0e209d39SAndroid Build Coastguard Worker      */
1087*0e209d39SAndroid Build Coastguard Worker     ULOC_ACCEPT_FAILED   = 0,
1088*0e209d39SAndroid Build Coastguard Worker     /**
1089*0e209d39SAndroid Build Coastguard Worker      * An exact match was found.
1090*0e209d39SAndroid Build Coastguard Worker      * \xrefitem stable "Stable" "Stable List" ICU 3.2
1091*0e209d39SAndroid Build Coastguard Worker      */
1092*0e209d39SAndroid Build Coastguard Worker     ULOC_ACCEPT_VALID    = 1,
1093*0e209d39SAndroid Build Coastguard Worker     /**
1094*0e209d39SAndroid Build Coastguard Worker      * A fallback was found. For example, the Accept-Language list includes 'ja_JP'
1095*0e209d39SAndroid Build Coastguard Worker      * and is matched with available locale 'ja'.
1096*0e209d39SAndroid Build Coastguard Worker      * \xrefitem stable "Stable" "Stable List" ICU 3.2
1097*0e209d39SAndroid Build Coastguard Worker      */
1098*0e209d39SAndroid Build Coastguard Worker     ULOC_ACCEPT_FALLBACK = 2   /*  */
1099*0e209d39SAndroid Build Coastguard Worker } UAcceptResult;
1100*0e209d39SAndroid Build Coastguard Worker 
1101*0e209d39SAndroid Build Coastguard Worker 
1102*0e209d39SAndroid Build Coastguard Worker 
1103*0e209d39SAndroid Build Coastguard Worker /**
1104*0e209d39SAndroid Build Coastguard Worker  * Based on a list of available locales,
1105*0e209d39SAndroid Build Coastguard Worker  * determine an acceptable locale for the user.
1106*0e209d39SAndroid Build Coastguard Worker  *
1107*0e209d39SAndroid Build Coastguard Worker  * This is a thin wrapper over C++ class LocaleMatcher.
1108*0e209d39SAndroid Build Coastguard Worker  *
1109*0e209d39SAndroid Build Coastguard Worker  * @param result - buffer to accept the result locale
1110*0e209d39SAndroid Build Coastguard Worker  * @param resultAvailable the size of the result buffer.
1111*0e209d39SAndroid Build Coastguard Worker  * @param outResult - An out parameter that contains the fallback status
1112*0e209d39SAndroid Build Coastguard Worker  * @param acceptList - list of acceptable languages
1113*0e209d39SAndroid Build Coastguard Worker  * @param acceptListCount - count of acceptList items
1114*0e209d39SAndroid Build Coastguard Worker  * @param availableLocales - list of available locales to match
1115*0e209d39SAndroid Build Coastguard Worker  * @param status ICU error code. Its input value must pass the U_SUCCESS() test,
1116*0e209d39SAndroid Build Coastguard Worker  *               or else the function returns immediately. Check for U_FAILURE()
1117*0e209d39SAndroid Build Coastguard Worker  *               on output or use with function chaining. (See User Guide for details.)
1118*0e209d39SAndroid Build Coastguard Worker  * @return length needed for the locale.
1119*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 3.2
1120*0e209d39SAndroid Build Coastguard Worker  */
1121*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1122*0e209d39SAndroid Build Coastguard Worker uloc_acceptLanguage(char *result, int32_t resultAvailable,
1123*0e209d39SAndroid Build Coastguard Worker                     UAcceptResult *outResult, const char **acceptList,
1124*0e209d39SAndroid Build Coastguard Worker                     int32_t acceptListCount,
1125*0e209d39SAndroid Build Coastguard Worker                     UEnumeration* availableLocales,
1126*0e209d39SAndroid Build Coastguard Worker                     UErrorCode *status) __INTRODUCED_IN(31);
1127*0e209d39SAndroid Build Coastguard Worker 
1128*0e209d39SAndroid Build Coastguard Worker 
1129*0e209d39SAndroid Build Coastguard Worker 
1130*0e209d39SAndroid Build Coastguard Worker 
1131*0e209d39SAndroid Build Coastguard Worker 
1132*0e209d39SAndroid Build Coastguard Worker 
1133*0e209d39SAndroid Build Coastguard Worker 
1134*0e209d39SAndroid Build Coastguard Worker /**
1135*0e209d39SAndroid Build Coastguard Worker  * Add the likely subtags for a provided locale ID, per the algorithm described
1136*0e209d39SAndroid Build Coastguard Worker  * in the following CLDR technical report:
1137*0e209d39SAndroid Build Coastguard Worker  *
1138*0e209d39SAndroid Build Coastguard Worker  *   http://www.unicode.org/reports/tr35/#Likely_Subtags
1139*0e209d39SAndroid Build Coastguard Worker  *
1140*0e209d39SAndroid Build Coastguard Worker  * If localeID is already in the maximal form, or there is no data available
1141*0e209d39SAndroid Build Coastguard Worker  * for maximization, it will be copied to the output buffer.  For example,
1142*0e209d39SAndroid Build Coastguard Worker  * "sh" cannot be maximized, since there is no reasonable maximization.
1143*0e209d39SAndroid Build Coastguard Worker  *
1144*0e209d39SAndroid Build Coastguard Worker  * Examples:
1145*0e209d39SAndroid Build Coastguard Worker  *
1146*0e209d39SAndroid Build Coastguard Worker  * "und_Zzzz" maximizes to "en_Latn_US"
1147*0e209d39SAndroid Build Coastguard Worker  *
1148*0e209d39SAndroid Build Coastguard Worker  * "en" maximizes to "en_Latn_US"
1149*0e209d39SAndroid Build Coastguard Worker  *
1150*0e209d39SAndroid Build Coastguard Worker  * "de" maximizes to "de_Latn_DE"
1151*0e209d39SAndroid Build Coastguard Worker  *
1152*0e209d39SAndroid Build Coastguard Worker  * "sr" maximizes to "sr_Cyrl_RS"
1153*0e209d39SAndroid Build Coastguard Worker  *
1154*0e209d39SAndroid Build Coastguard Worker  * "zh_Hani" maximizes to "zh_Hani_CN"
1155*0e209d39SAndroid Build Coastguard Worker  *
1156*0e209d39SAndroid Build Coastguard Worker  *
1157*0e209d39SAndroid Build Coastguard Worker  * @param localeID The locale to maximize
1158*0e209d39SAndroid Build Coastguard Worker  * @param maximizedLocaleID The maximized locale
1159*0e209d39SAndroid Build Coastguard Worker  * @param maximizedLocaleIDCapacity The capacity of the maximizedLocaleID buffer
1160*0e209d39SAndroid Build Coastguard Worker  * @param err Error information if maximizing the locale failed.  If the length
1161*0e209d39SAndroid Build Coastguard Worker  * of the localeID and the null-terminator is greater than the maximum allowed size,
1162*0e209d39SAndroid Build Coastguard Worker  * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
1163*0e209d39SAndroid Build Coastguard Worker  * @return The actual buffer size needed for the maximized locale.  If it's
1164*0e209d39SAndroid Build Coastguard Worker  * greater than maximizedLocaleIDCapacity, the returned ID will be truncated.
1165*0e209d39SAndroid Build Coastguard Worker  * On error, the return value is -1.
1166*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.0
1167*0e209d39SAndroid Build Coastguard Worker  */
1168*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1169*0e209d39SAndroid Build Coastguard Worker uloc_addLikelySubtags(const char*    localeID,
1170*0e209d39SAndroid Build Coastguard Worker          char* maximizedLocaleID,
1171*0e209d39SAndroid Build Coastguard Worker          int32_t maximizedLocaleIDCapacity,
1172*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
1173*0e209d39SAndroid Build Coastguard Worker 
1174*0e209d39SAndroid Build Coastguard Worker 
1175*0e209d39SAndroid Build Coastguard Worker 
1176*0e209d39SAndroid Build Coastguard Worker 
1177*0e209d39SAndroid Build Coastguard Worker /**
1178*0e209d39SAndroid Build Coastguard Worker  * Minimize the subtags for a provided locale ID, per the algorithm described
1179*0e209d39SAndroid Build Coastguard Worker  * in the following CLDR technical report:
1180*0e209d39SAndroid Build Coastguard Worker  *
1181*0e209d39SAndroid Build Coastguard Worker  *   http://www.unicode.org/reports/tr35/#Likely_Subtags
1182*0e209d39SAndroid Build Coastguard Worker  *
1183*0e209d39SAndroid Build Coastguard Worker  * If localeID is already in the minimal form, or there is no data available
1184*0e209d39SAndroid Build Coastguard Worker  * for minimization, it will be copied to the output buffer.  Since the
1185*0e209d39SAndroid Build Coastguard Worker  * minimization algorithm relies on proper maximization, see the comments
1186*0e209d39SAndroid Build Coastguard Worker  * for uloc_addLikelySubtags for reasons why there might not be any data.
1187*0e209d39SAndroid Build Coastguard Worker  *
1188*0e209d39SAndroid Build Coastguard Worker  * Examples:
1189*0e209d39SAndroid Build Coastguard Worker  *
1190*0e209d39SAndroid Build Coastguard Worker  * "en_Latn_US" minimizes to "en"
1191*0e209d39SAndroid Build Coastguard Worker  *
1192*0e209d39SAndroid Build Coastguard Worker  * "de_Latn_US" minimizes to "de"
1193*0e209d39SAndroid Build Coastguard Worker  *
1194*0e209d39SAndroid Build Coastguard Worker  * "sr_Cyrl_RS" minimizes to "sr"
1195*0e209d39SAndroid Build Coastguard Worker  *
1196*0e209d39SAndroid Build Coastguard Worker  * "zh_Hant_TW" minimizes to "zh_TW" (The region is preferred to the
1197*0e209d39SAndroid Build Coastguard Worker  * script, and minimizing to "zh" would imply "zh_Hans_CN".)
1198*0e209d39SAndroid Build Coastguard Worker  *
1199*0e209d39SAndroid Build Coastguard Worker  * @param localeID The locale to minimize
1200*0e209d39SAndroid Build Coastguard Worker  * @param minimizedLocaleID The minimized locale
1201*0e209d39SAndroid Build Coastguard Worker  * @param minimizedLocaleIDCapacity The capacity of the minimizedLocaleID buffer
1202*0e209d39SAndroid Build Coastguard Worker  * @param err Error information if minimizing the locale failed.  If the length
1203*0e209d39SAndroid Build Coastguard Worker  * of the localeID and the null-terminator is greater than the maximum allowed size,
1204*0e209d39SAndroid Build Coastguard Worker  * or the localeId is not well-formed, the error code is U_ILLEGAL_ARGUMENT_ERROR.
1205*0e209d39SAndroid Build Coastguard Worker  * @return The actual buffer size needed for the minimized locale.  If it's
1206*0e209d39SAndroid Build Coastguard Worker  * greater than minimizedLocaleIDCapacity, the returned ID will be truncated.
1207*0e209d39SAndroid Build Coastguard Worker  * On error, the return value is -1.
1208*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.0
1209*0e209d39SAndroid Build Coastguard Worker  */
1210*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1211*0e209d39SAndroid Build Coastguard Worker uloc_minimizeSubtags(const char*    localeID,
1212*0e209d39SAndroid Build Coastguard Worker          char* minimizedLocaleID,
1213*0e209d39SAndroid Build Coastguard Worker          int32_t minimizedLocaleIDCapacity,
1214*0e209d39SAndroid Build Coastguard Worker          UErrorCode* err) __INTRODUCED_IN(31);
1215*0e209d39SAndroid Build Coastguard Worker 
1216*0e209d39SAndroid Build Coastguard Worker 
1217*0e209d39SAndroid Build Coastguard Worker 
1218*0e209d39SAndroid Build Coastguard Worker /**
1219*0e209d39SAndroid Build Coastguard Worker  * Returns a locale ID for the specified BCP47 language tag string.
1220*0e209d39SAndroid Build Coastguard Worker  * If the specified language tag contains any ill-formed subtags,
1221*0e209d39SAndroid Build Coastguard Worker  * the first such subtag and all following subtags are ignored.
1222*0e209d39SAndroid Build Coastguard Worker  * <p>
1223*0e209d39SAndroid Build Coastguard Worker  * This implements the 'Language-Tag' production of BCP 47, and so
1224*0e209d39SAndroid Build Coastguard Worker  * supports legacy language tags (marked as “Type: grandfathered” in BCP 47)
1225*0e209d39SAndroid Build Coastguard Worker  * (regular and irregular) as well as private use language tags.
1226*0e209d39SAndroid Build Coastguard Worker  *
1227*0e209d39SAndroid Build Coastguard Worker  * Private use tags are represented as 'x-whatever',
1228*0e209d39SAndroid Build Coastguard Worker  * and legacy tags are converted to their canonical replacements where they exist.
1229*0e209d39SAndroid Build Coastguard Worker  *
1230*0e209d39SAndroid Build Coastguard Worker  * Note that a few legacy tags have no modern replacement;
1231*0e209d39SAndroid Build Coastguard Worker  * these will be converted using the fallback described in
1232*0e209d39SAndroid Build Coastguard Worker  * the first paragraph, so some information might be lost.
1233*0e209d39SAndroid Build Coastguard Worker  *
1234*0e209d39SAndroid Build Coastguard Worker  * @param langtag   the input BCP47 language tag.
1235*0e209d39SAndroid Build Coastguard Worker  * @param localeID  the output buffer receiving a locale ID for the
1236*0e209d39SAndroid Build Coastguard Worker  *                  specified BCP47 language tag.
1237*0e209d39SAndroid Build Coastguard Worker  * @param localeIDCapacity  the size of the locale ID output buffer.
1238*0e209d39SAndroid Build Coastguard Worker  * @param parsedLength  if not NULL, successfully parsed length
1239*0e209d39SAndroid Build Coastguard Worker  *                      for the input language tag is set.
1240*0e209d39SAndroid Build Coastguard Worker  * @param err       error information if receiving the locald ID
1241*0e209d39SAndroid Build Coastguard Worker  *                  failed.
1242*0e209d39SAndroid Build Coastguard Worker  * @return          the length of the locale ID.
1243*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.2
1244*0e209d39SAndroid Build Coastguard Worker  */
1245*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1246*0e209d39SAndroid Build Coastguard Worker uloc_forLanguageTag(const char* langtag,
1247*0e209d39SAndroid Build Coastguard Worker                     char* localeID,
1248*0e209d39SAndroid Build Coastguard Worker                     int32_t localeIDCapacity,
1249*0e209d39SAndroid Build Coastguard Worker                     int32_t* parsedLength,
1250*0e209d39SAndroid Build Coastguard Worker                     UErrorCode* err) __INTRODUCED_IN(31);
1251*0e209d39SAndroid Build Coastguard Worker 
1252*0e209d39SAndroid Build Coastguard Worker 
1253*0e209d39SAndroid Build Coastguard Worker 
1254*0e209d39SAndroid Build Coastguard Worker /**
1255*0e209d39SAndroid Build Coastguard Worker  * Returns a well-formed language tag for this locale ID.
1256*0e209d39SAndroid Build Coastguard Worker  * <p>
1257*0e209d39SAndroid Build Coastguard Worker  * <b>Note</b>: When <code>strict</code> is false, any locale
1258*0e209d39SAndroid Build Coastguard Worker  * fields which do not satisfy the BCP47 syntax requirement will
1259*0e209d39SAndroid Build Coastguard Worker  * be omitted from the result.  When <code>strict</code> is
1260*0e209d39SAndroid Build Coastguard Worker  * true, this function sets U_ILLEGAL_ARGUMENT_ERROR to the
1261*0e209d39SAndroid Build Coastguard Worker  * <code>err</code> if any locale fields do not satisfy the
1262*0e209d39SAndroid Build Coastguard Worker  * BCP47 syntax requirement.
1263*0e209d39SAndroid Build Coastguard Worker  * @param localeID  the input locale ID
1264*0e209d39SAndroid Build Coastguard Worker  * @param langtag   the output buffer receiving BCP47 language
1265*0e209d39SAndroid Build Coastguard Worker  *                  tag for the locale ID.
1266*0e209d39SAndroid Build Coastguard Worker  * @param langtagCapacity   the size of the BCP47 language tag
1267*0e209d39SAndroid Build Coastguard Worker  *                          output buffer.
1268*0e209d39SAndroid Build Coastguard Worker  * @param strict    boolean value indicating if the function returns
1269*0e209d39SAndroid Build Coastguard Worker  *                  an error for an ill-formed input locale ID.
1270*0e209d39SAndroid Build Coastguard Worker  * @param err       error information if receiving the language
1271*0e209d39SAndroid Build Coastguard Worker  *                  tag failed.
1272*0e209d39SAndroid Build Coastguard Worker  * @return          The length of the BCP47 language tag.
1273*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 4.2
1274*0e209d39SAndroid Build Coastguard Worker  */
1275*0e209d39SAndroid Build Coastguard Worker U_CAPI int32_t U_EXPORT2
1276*0e209d39SAndroid Build Coastguard Worker uloc_toLanguageTag(const char* localeID,
1277*0e209d39SAndroid Build Coastguard Worker                    char* langtag,
1278*0e209d39SAndroid Build Coastguard Worker                    int32_t langtagCapacity,
1279*0e209d39SAndroid Build Coastguard Worker                    UBool strict,
1280*0e209d39SAndroid Build Coastguard Worker                    UErrorCode* err) __INTRODUCED_IN(31);
1281*0e209d39SAndroid Build Coastguard Worker 
1282*0e209d39SAndroid Build Coastguard Worker 
1283*0e209d39SAndroid Build Coastguard Worker 
1284*0e209d39SAndroid Build Coastguard Worker /**
1285*0e209d39SAndroid Build Coastguard Worker  * Converts the specified keyword (legacy key, or BCP 47 Unicode locale
1286*0e209d39SAndroid Build Coastguard Worker  * extension key) to the equivalent BCP 47 Unicode locale extension key.
1287*0e209d39SAndroid Build Coastguard Worker  * For example, BCP 47 Unicode locale extension key "co" is returned for
1288*0e209d39SAndroid Build Coastguard Worker  * the input keyword "collation".
1289*0e209d39SAndroid Build Coastguard Worker  * <p>
1290*0e209d39SAndroid Build Coastguard Worker  * When the specified keyword is unknown, but satisfies the BCP syntax,
1291*0e209d39SAndroid Build Coastguard Worker  * then the pointer to the input keyword itself will be returned.
1292*0e209d39SAndroid Build Coastguard Worker  * For example,
1293*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_toUnicodeLocaleKey("ZZ")</code> returns "ZZ".
1294*0e209d39SAndroid Build Coastguard Worker  *
1295*0e209d39SAndroid Build Coastguard Worker  * @param keyword       the input locale keyword (either legacy key
1296*0e209d39SAndroid Build Coastguard Worker  *                      such as "collation" or BCP 47 Unicode locale extension
1297*0e209d39SAndroid Build Coastguard Worker  *                      key such as "co").
1298*0e209d39SAndroid Build Coastguard Worker  * @return              the well-formed BCP 47 Unicode locale extension key,
1299*0e209d39SAndroid Build Coastguard Worker  *                      or NULL if the specified locale keyword cannot be
1300*0e209d39SAndroid Build Coastguard Worker  *                      mapped to a well-formed BCP 47 Unicode locale extension
1301*0e209d39SAndroid Build Coastguard Worker  *                      key.
1302*0e209d39SAndroid Build Coastguard Worker  * @see uloc_toLegacyKey
1303*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 54
1304*0e209d39SAndroid Build Coastguard Worker  */
1305*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
1306*0e209d39SAndroid Build Coastguard Worker uloc_toUnicodeLocaleKey(const char* keyword) __INTRODUCED_IN(31);
1307*0e209d39SAndroid Build Coastguard Worker 
1308*0e209d39SAndroid Build Coastguard Worker 
1309*0e209d39SAndroid Build Coastguard Worker 
1310*0e209d39SAndroid Build Coastguard Worker /**
1311*0e209d39SAndroid Build Coastguard Worker  * Converts the specified keyword value (legacy type, or BCP 47
1312*0e209d39SAndroid Build Coastguard Worker  * Unicode locale extension type) to the well-formed BCP 47 Unicode locale
1313*0e209d39SAndroid Build Coastguard Worker  * extension type for the specified keyword (category). For example, BCP 47
1314*0e209d39SAndroid Build Coastguard Worker  * Unicode locale extension type "phonebk" is returned for the input
1315*0e209d39SAndroid Build Coastguard Worker  * keyword value "phonebook", with the keyword "collation" (or "co").
1316*0e209d39SAndroid Build Coastguard Worker  * <p>
1317*0e209d39SAndroid Build Coastguard Worker  * When the specified keyword is not recognized, but the specified value
1318*0e209d39SAndroid Build Coastguard Worker  * satisfies the syntax of the BCP 47 Unicode locale extension type,
1319*0e209d39SAndroid Build Coastguard Worker  * or when the specified keyword allows 'variable' type and the specified
1320*0e209d39SAndroid Build Coastguard Worker  * value satisfies the syntax,  then the pointer to the input type value itself
1321*0e209d39SAndroid Build Coastguard Worker  * will be returned.
1322*0e209d39SAndroid Build Coastguard Worker  * For example,
1323*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_toUnicodeLocaleType("Foo", "Bar")</code> returns "Bar",
1324*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_toUnicodeLocaleType("variableTop", "00A4")</code> returns "00A4".
1325*0e209d39SAndroid Build Coastguard Worker  *
1326*0e209d39SAndroid Build Coastguard Worker  * @param keyword       the locale keyword (either legacy key such as
1327*0e209d39SAndroid Build Coastguard Worker  *                      "collation" or BCP 47 Unicode locale extension
1328*0e209d39SAndroid Build Coastguard Worker  *                      key such as "co").
1329*0e209d39SAndroid Build Coastguard Worker  * @param value         the locale keyword value (either legacy type
1330*0e209d39SAndroid Build Coastguard Worker  *                      such as "phonebook" or BCP 47 Unicode locale extension
1331*0e209d39SAndroid Build Coastguard Worker  *                      type such as "phonebk").
1332*0e209d39SAndroid Build Coastguard Worker  * @return              the well-formed BCP47 Unicode locale extension type,
1333*0e209d39SAndroid Build Coastguard Worker  *                      or NULL if the locale keyword value cannot be mapped to
1334*0e209d39SAndroid Build Coastguard Worker  *                      a well-formed BCP 47 Unicode locale extension type.
1335*0e209d39SAndroid Build Coastguard Worker  * @see uloc_toLegacyType
1336*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 54
1337*0e209d39SAndroid Build Coastguard Worker  */
1338*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
1339*0e209d39SAndroid Build Coastguard Worker uloc_toUnicodeLocaleType(const char* keyword, const char* value) __INTRODUCED_IN(31);
1340*0e209d39SAndroid Build Coastguard Worker 
1341*0e209d39SAndroid Build Coastguard Worker 
1342*0e209d39SAndroid Build Coastguard Worker 
1343*0e209d39SAndroid Build Coastguard Worker /**
1344*0e209d39SAndroid Build Coastguard Worker  * Converts the specified keyword (BCP 47 Unicode locale extension key, or
1345*0e209d39SAndroid Build Coastguard Worker  * legacy key) to the legacy key. For example, legacy key "collation" is
1346*0e209d39SAndroid Build Coastguard Worker  * returned for the input BCP 47 Unicode locale extension key "co".
1347*0e209d39SAndroid Build Coastguard Worker  *
1348*0e209d39SAndroid Build Coastguard Worker  * @param keyword       the input locale keyword (either BCP 47 Unicode locale
1349*0e209d39SAndroid Build Coastguard Worker  *                      extension key or legacy key).
1350*0e209d39SAndroid Build Coastguard Worker  * @return              the well-formed legacy key, or NULL if the specified
1351*0e209d39SAndroid Build Coastguard Worker  *                      keyword cannot be mapped to a well-formed legacy key.
1352*0e209d39SAndroid Build Coastguard Worker  * @see toUnicodeLocaleKey
1353*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 54
1354*0e209d39SAndroid Build Coastguard Worker  */
1355*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
1356*0e209d39SAndroid Build Coastguard Worker uloc_toLegacyKey(const char* keyword) __INTRODUCED_IN(31);
1357*0e209d39SAndroid Build Coastguard Worker 
1358*0e209d39SAndroid Build Coastguard Worker 
1359*0e209d39SAndroid Build Coastguard Worker 
1360*0e209d39SAndroid Build Coastguard Worker /**
1361*0e209d39SAndroid Build Coastguard Worker  * Converts the specified keyword value (BCP 47 Unicode locale extension type,
1362*0e209d39SAndroid Build Coastguard Worker  * or legacy type or type alias) to the canonical legacy type. For example,
1363*0e209d39SAndroid Build Coastguard Worker  * the legacy type "phonebook" is returned for the input BCP 47 Unicode
1364*0e209d39SAndroid Build Coastguard Worker  * locale extension type "phonebk" with the keyword "collation" (or "co").
1365*0e209d39SAndroid Build Coastguard Worker  * <p>
1366*0e209d39SAndroid Build Coastguard Worker  * When the specified keyword is not recognized, but the specified value
1367*0e209d39SAndroid Build Coastguard Worker  * satisfies the syntax of legacy key, or when the specified keyword
1368*0e209d39SAndroid Build Coastguard Worker  * allows 'variable' type and the specified value satisfies the syntax,
1369*0e209d39SAndroid Build Coastguard Worker  * then the pointer to the input type value itself will be returned.
1370*0e209d39SAndroid Build Coastguard Worker  * For example,
1371*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_toLegacyType("Foo", "Bar")</code> returns "Bar",
1372*0e209d39SAndroid Build Coastguard Worker  * <code>uloc_toLegacyType("vt", "00A4")</code> returns "00A4".
1373*0e209d39SAndroid Build Coastguard Worker  *
1374*0e209d39SAndroid Build Coastguard Worker  * @param keyword       the locale keyword (either legacy keyword such as
1375*0e209d39SAndroid Build Coastguard Worker  *                      "collation" or BCP 47 Unicode locale extension
1376*0e209d39SAndroid Build Coastguard Worker  *                      key such as "co").
1377*0e209d39SAndroid Build Coastguard Worker  * @param value         the locale keyword value (either BCP 47 Unicode locale
1378*0e209d39SAndroid Build Coastguard Worker  *                      extension type such as "phonebk" or legacy keyword value
1379*0e209d39SAndroid Build Coastguard Worker  *                      such as "phonebook").
1380*0e209d39SAndroid Build Coastguard Worker  * @return              the well-formed legacy type, or NULL if the specified
1381*0e209d39SAndroid Build Coastguard Worker  *                      keyword value cannot be mapped to a well-formed legacy
1382*0e209d39SAndroid Build Coastguard Worker  *                      type.
1383*0e209d39SAndroid Build Coastguard Worker  * @see toUnicodeLocaleType
1384*0e209d39SAndroid Build Coastguard Worker  * \xrefitem stable "Stable" "Stable List" ICU 54
1385*0e209d39SAndroid Build Coastguard Worker  */
1386*0e209d39SAndroid Build Coastguard Worker U_CAPI const char* U_EXPORT2
1387*0e209d39SAndroid Build Coastguard Worker uloc_toLegacyType(const char* keyword, const char* value) __INTRODUCED_IN(31);
1388*0e209d39SAndroid Build Coastguard Worker 
1389*0e209d39SAndroid Build Coastguard Worker 
1390*0e209d39SAndroid Build Coastguard Worker 
1391*0e209d39SAndroid Build Coastguard Worker #endif /*_ULOC*/
1392*0e209d39SAndroid Build Coastguard Worker 
1393*0e209d39SAndroid Build Coastguard Worker /** @} */ // addtogroup
1394