OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (C) 1997-2014, International Business Machines | 3 * Copyright (C) 1997-2015, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 * | 6 * |
7 * File ULOC.H | 7 * File ULOC.H |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
11 * Date Name Description | 11 * Date Name Description |
12 * 04/01/97 aliu Creation. | 12 * 04/01/97 aliu Creation. |
13 * 08/22/98 stephen JDK 1.2 sync. | 13 * 08/22/98 stephen JDK 1.2 sync. |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 * @return the length needed for the buffer | 879 * @return the length needed for the buffer |
880 * @see uloc_getKeywordValue | 880 * @see uloc_getKeywordValue |
881 * @stable ICU 3.2 | 881 * @stable ICU 3.2 |
882 */ | 882 */ |
883 U_STABLE int32_t U_EXPORT2 | 883 U_STABLE int32_t U_EXPORT2 |
884 uloc_setKeywordValue(const char* keywordName, | 884 uloc_setKeywordValue(const char* keywordName, |
885 const char* keywordValue, | 885 const char* keywordValue, |
886 char* buffer, int32_t bufferCapacity, | 886 char* buffer, int32_t bufferCapacity, |
887 UErrorCode* status); | 887 UErrorCode* status); |
888 | 888 |
889 #ifndef U_HIDE_DRAFT_API | |
890 /** | 889 /** |
891 * Returns whether the locale's script is written right-to-left. | 890 * Returns whether the locale's script is written right-to-left. |
892 * If there is no script subtag, then the likely script is used, see uloc_addLik
elySubtags(). | 891 * If there is no script subtag, then the likely script is used, see uloc_addLik
elySubtags(). |
893 * If no likely script is known, then FALSE is returned. | 892 * If no likely script is known, then FALSE is returned. |
894 * | 893 * |
895 * A script is right-to-left according to the CLDR script metadata | 894 * A script is right-to-left according to the CLDR script metadata |
896 * which corresponds to whether the script's letters have Bidi_Class=R or AL. | 895 * which corresponds to whether the script's letters have Bidi_Class=R or AL. |
897 * | 896 * |
898 * Returns TRUE for "ar" and "en-Hebr", FALSE for "zh" and "fa-Cyrl". | 897 * Returns TRUE for "ar" and "en-Hebr", FALSE for "zh" and "fa-Cyrl". |
899 * | 898 * |
900 * @param locale input locale ID | 899 * @param locale input locale ID |
901 * @return TRUE if the locale's script is written right-to-left | 900 * @return TRUE if the locale's script is written right-to-left |
902 * @draft ICU 54 | 901 * @stable ICU 54 |
903 */ | 902 */ |
904 U_DRAFT UBool U_EXPORT2 | 903 U_STABLE UBool U_EXPORT2 |
905 uloc_isRightToLeft(const char *locale); | 904 uloc_isRightToLeft(const char *locale); |
906 #endif /* U_HIDE_DRAFT_API */ | |
907 | 905 |
908 /** | 906 /** |
909 * enums for the return value for the character and line orientation | 907 * enums for the return value for the character and line orientation |
910 * functions. | 908 * functions. |
911 * @stable ICU 4.0 | 909 * @stable ICU 4.0 |
912 */ | 910 */ |
913 typedef enum { | 911 typedef enum { |
914 ULOC_LAYOUT_LTR = 0, /* left-to-right. */ | 912 ULOC_LAYOUT_LTR = 0, /* left-to-right. */ |
915 ULOC_LAYOUT_RTL = 1, /* right-to-left. */ | 913 ULOC_LAYOUT_RTL = 1, /* right-to-left. */ |
916 ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */ | 914 ULOC_LAYOUT_TTB = 2, /* top-to-bottom. */ |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 * @return The length of the BCP47 language tag. | 1142 * @return The length of the BCP47 language tag. |
1145 * @stable ICU 4.2 | 1143 * @stable ICU 4.2 |
1146 */ | 1144 */ |
1147 U_STABLE int32_t U_EXPORT2 | 1145 U_STABLE int32_t U_EXPORT2 |
1148 uloc_toLanguageTag(const char* localeID, | 1146 uloc_toLanguageTag(const char* localeID, |
1149 char* langtag, | 1147 char* langtag, |
1150 int32_t langtagCapacity, | 1148 int32_t langtagCapacity, |
1151 UBool strict, | 1149 UBool strict, |
1152 UErrorCode* err); | 1150 UErrorCode* err); |
1153 | 1151 |
1154 #ifndef U_HIDE_DRAFT_API | |
1155 /** | 1152 /** |
1156 * Converts the specified keyword (legacy key, or BCP 47 Unicode locale | 1153 * Converts the specified keyword (legacy key, or BCP 47 Unicode locale |
1157 * extension key) to the equivalent BCP 47 Unicode locale extension key. | 1154 * extension key) to the equivalent BCP 47 Unicode locale extension key. |
1158 * For example, BCP 47 Unicode locale extension key "co" is returned for | 1155 * For example, BCP 47 Unicode locale extension key "co" is returned for |
1159 * the input keyword "collation". | 1156 * the input keyword "collation". |
1160 * <p> | 1157 * <p> |
1161 * When the specified keyword is unknown, but satisfies the BCP syntax, | 1158 * When the specified keyword is unknown, but satisfies the BCP syntax, |
1162 * then the pointer to the input keyword itself will be returned. | 1159 * then the pointer to the input keyword itself will be returned. |
1163 * For example, | 1160 * For example, |
1164 * <code>uloc_toUnicodeLocaleKey("ZZ")</code> returns "ZZ". | 1161 * <code>uloc_toUnicodeLocaleKey("ZZ")</code> returns "ZZ". |
1165 * | 1162 * |
1166 * @param keyword the input locale keyword (either legacy key | 1163 * @param keyword the input locale keyword (either legacy key |
1167 * such as "collation" or BCP 47 Unicode locale extension | 1164 * such as "collation" or BCP 47 Unicode locale extension |
1168 * key such as "co"). | 1165 * key such as "co"). |
1169 * @return the well-formed BCP 47 Unicode locale extension key, | 1166 * @return the well-formed BCP 47 Unicode locale extension key, |
1170 * or NULL if the specified locale keyword cannot be | 1167 * or NULL if the specified locale keyword cannot be |
1171 * mapped to a well-formed BCP 47 Unicode locale extension | 1168 * mapped to a well-formed BCP 47 Unicode locale extension |
1172 * key. | 1169 * key. |
1173 * @see uloc_toLegacyKey | 1170 * @see uloc_toLegacyKey |
1174 * @draft ICU 54 | 1171 * @stable ICU 54 |
1175 */ | 1172 */ |
1176 U_DRAFT const char* U_EXPORT2 | 1173 U_STABLE const char* U_EXPORT2 |
1177 uloc_toUnicodeLocaleKey(const char* keyword); | 1174 uloc_toUnicodeLocaleKey(const char* keyword); |
1178 | 1175 |
1179 /** | 1176 /** |
1180 * Converts the specified keyword value (legacy type, or BCP 47 | 1177 * Converts the specified keyword value (legacy type, or BCP 47 |
1181 * Unicode locale extension type) to the well-formed BCP 47 Unicode locale | 1178 * Unicode locale extension type) to the well-formed BCP 47 Unicode locale |
1182 * extension type for the specified keyword (category). For example, BCP 47 | 1179 * extension type for the specified keyword (category). For example, BCP 47 |
1183 * Unicode locale extension type "phonebk" is returned for the input | 1180 * Unicode locale extension type "phonebk" is returned for the input |
1184 * keyword value "phonebook", with the keyword "collation" (or "co"). | 1181 * keyword value "phonebook", with the keyword "collation" (or "co"). |
1185 * <p> | 1182 * <p> |
1186 * When the specified keyword is not recognized, but the specified value | 1183 * When the specified keyword is not recognized, but the specified value |
1187 * satisfies the syntax of the BCP 47 Unicode locale extension type, | 1184 * satisfies the syntax of the BCP 47 Unicode locale extension type, |
1188 * or when the specified keyword allows 'variable' type and the specified | 1185 * or when the specified keyword allows 'variable' type and the specified |
1189 * value satisfies the syntax, then the pointer to the input type value itself | 1186 * value satisfies the syntax, then the pointer to the input type value itself |
1190 * will be returned. | 1187 * will be returned. |
1191 * For example, | 1188 * For example, |
1192 * <code>uloc_toUnicodeLocaleType("Foo", "Bar")</code> returns "Bar", | 1189 * <code>uloc_toUnicodeLocaleType("Foo", "Bar")</code> returns "Bar", |
1193 * <code>uloc_toUnicodeLocaleType("variableTop", "00A4")</code> returns "00A4". | 1190 * <code>uloc_toUnicodeLocaleType("variableTop", "00A4")</code> returns "00A4". |
1194 * | 1191 * |
1195 * @param keyword the locale keyword (either legacy key such as | 1192 * @param keyword the locale keyword (either legacy key such as |
1196 * "collation" or BCP 47 Unicode locale extension | 1193 * "collation" or BCP 47 Unicode locale extension |
1197 * key such as "co"). | 1194 * key such as "co"). |
1198 * @param value the locale keyword value (either legacy type | 1195 * @param value the locale keyword value (either legacy type |
1199 * such as "phonebook" or BCP 47 Unicode locale extension | 1196 * such as "phonebook" or BCP 47 Unicode locale extension |
1200 * type such as "phonebk"). | 1197 * type such as "phonebk"). |
1201 * @return the well-formed BCP47 Unicode locale extension type, | 1198 * @return the well-formed BCP47 Unicode locale extension type, |
1202 * or NULL if the locale keyword value cannot be mapped to | 1199 * or NULL if the locale keyword value cannot be mapped to |
1203 * a well-formed BCP 47 Unicode locale extension type. | 1200 * a well-formed BCP 47 Unicode locale extension type. |
1204 * @see uloc_toLegacyType | 1201 * @see uloc_toLegacyType |
1205 * @draft ICU 54 | 1202 * @stable ICU 54 |
1206 */ | 1203 */ |
1207 U_DRAFT const char* U_EXPORT2 | 1204 U_STABLE const char* U_EXPORT2 |
1208 uloc_toUnicodeLocaleType(const char* keyword, const char* value); | 1205 uloc_toUnicodeLocaleType(const char* keyword, const char* value); |
1209 | 1206 |
1210 /** | 1207 /** |
1211 * Converts the specified keyword (BCP 47 Unicode locale extension key, or | 1208 * Converts the specified keyword (BCP 47 Unicode locale extension key, or |
1212 * legacy key) to the legacy key. For example, legacy key "collation" is | 1209 * legacy key) to the legacy key. For example, legacy key "collation" is |
1213 * returned for the input BCP 47 Unicode locale extension key "co". | 1210 * returned for the input BCP 47 Unicode locale extension key "co". |
1214 * | 1211 * |
1215 * @param keyword the input locale keyword (either BCP 47 Unicode locale | 1212 * @param keyword the input locale keyword (either BCP 47 Unicode locale |
1216 * extension key or legacy key). | 1213 * extension key or legacy key). |
1217 * @return the well-formed legacy key, or NULL if the specified | 1214 * @return the well-formed legacy key, or NULL if the specified |
1218 * keyword cannot be mapped to a well-formed legacy key. | 1215 * keyword cannot be mapped to a well-formed legacy key. |
1219 * @see toUnicodeLocaleKey | 1216 * @see toUnicodeLocaleKey |
1220 * @draft ICU 54 | 1217 * @stable ICU 54 |
1221 */ | 1218 */ |
1222 U_DRAFT const char* U_EXPORT2 | 1219 U_STABLE const char* U_EXPORT2 |
1223 uloc_toLegacyKey(const char* keyword); | 1220 uloc_toLegacyKey(const char* keyword); |
1224 | 1221 |
1225 /** | 1222 /** |
1226 * Converts the specified keyword value (BCP 47 Unicode locale extension type, | 1223 * Converts the specified keyword value (BCP 47 Unicode locale extension type, |
1227 * or legacy type or type alias) to the canonical legacy type. For example, | 1224 * or legacy type or type alias) to the canonical legacy type. For example, |
1228 * the legacy type "phonebook" is returned for the input BCP 47 Unicode | 1225 * the legacy type "phonebook" is returned for the input BCP 47 Unicode |
1229 * locale extension type "phonebk" with the keyword "collation" (or "co"). | 1226 * locale extension type "phonebk" with the keyword "collation" (or "co"). |
1230 * <p> | 1227 * <p> |
1231 * When the specified keyword is not recognized, but the specified value | 1228 * When the specified keyword is not recognized, but the specified value |
1232 * satisfies the syntax of legacy key, or when the specified keyword | 1229 * satisfies the syntax of legacy key, or when the specified keyword |
1233 * allows 'variable' type and the specified value satisfies the syntax, | 1230 * allows 'variable' type and the specified value satisfies the syntax, |
1234 * then the pointer to the input type value itself will be returned. | 1231 * then the pointer to the input type value itself will be returned. |
1235 * For example, | 1232 * For example, |
1236 * <code>uloc_toLegacyType("Foo", "Bar")</code> returns "Bar", | 1233 * <code>uloc_toLegacyType("Foo", "Bar")</code> returns "Bar", |
1237 * <code>uloc_toLegacyType("vt", "00A4")</code> returns "00A4". | 1234 * <code>uloc_toLegacyType("vt", "00A4")</code> returns "00A4". |
1238 * | 1235 * |
1239 * @param keyword the locale keyword (either legacy keyword such as | 1236 * @param keyword the locale keyword (either legacy keyword such as |
1240 * "collation" or BCP 47 Unicode locale extension | 1237 * "collation" or BCP 47 Unicode locale extension |
1241 * key such as "co"). | 1238 * key such as "co"). |
1242 * @param value the locale keyword value (either BCP 47 Unicode locale | 1239 * @param value the locale keyword value (either BCP 47 Unicode locale |
1243 * extension type such as "phonebk" or legacy keyword value | 1240 * extension type such as "phonebk" or legacy keyword value |
1244 * such as "phonebook"). | 1241 * such as "phonebook"). |
1245 * @return the well-formed legacy type, or NULL if the specified | 1242 * @return the well-formed legacy type, or NULL if the specified |
1246 * keyword value cannot be mapped to a well-formed legacy | 1243 * keyword value cannot be mapped to a well-formed legacy |
1247 * type. | 1244 * type. |
1248 * @see toUnicodeLocaleType | 1245 * @see toUnicodeLocaleType |
1249 * @draft ICU 54 | 1246 * @stable ICU 54 |
1250 */ | 1247 */ |
1251 U_DRAFT const char* U_EXPORT2 | 1248 U_STABLE const char* U_EXPORT2 |
1252 uloc_toLegacyType(const char* keyword, const char* value); | 1249 uloc_toLegacyType(const char* keyword, const char* value); |
1253 | 1250 |
1254 #endif /* U_HIDE_DRAFT_API */ | |
1255 | |
1256 #endif /*_ULOC*/ | 1251 #endif /*_ULOC*/ |
OLD | NEW |