Freigeben über


ULocale.ToUnicodeLocaleType(String, String) Method

Definition

<strong>[icu]</strong> Converts the specified keyword value (legacy type, or BCP 47 Unicode locale extension type) to the well-formed BCP 47 Unicode locale extension type for the specified keyword (category).

[Android.Runtime.Register("toUnicodeLocaleType", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "", ApiSince=24)]
public static string? ToUnicodeLocaleType (string? keyword, string? value);
[<Android.Runtime.Register("toUnicodeLocaleType", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "", ApiSince=24)>]
static member ToUnicodeLocaleType : string * string -> string

Parameters

keyword
String

the locale keyword (either legacy key such as "collation" or BCP 47 Unicode locale extension key such as "co").

value
String

the locale keyword value (either legacy type such as "phonebook" or BCP 47 Unicode locale extension type such as "phonebk").

Returns

the well-formed BCP47 Unicode locale extension type, or null if the locale keyword value cannot be mapped to a well-formed BCP 47 Unicode locale extension type.

Attributes

Remarks

<strong>[icu]</strong> Converts the specified keyword value (legacy type, or BCP 47 Unicode locale extension type) to the well-formed BCP 47 Unicode locale extension type for the specified keyword (category). For example, BCP 47 Unicode locale extension type "phonebk" is returned for the input keyword value "phonebook", with the keyword "collation" (or "co").

When the specified keyword is not recognized, but the specified value satisfies the syntax of the BCP 47 Unicode locale extension type, or when the specified keyword allows 'variable' type and the specified value satisfies the syntax, the lower-case version of the input value will be returned. For example, toUnicodeLocaleType("Foo", "Bar") returns "bar", toUnicodeLocaleType("variableTop", "00A4") returns "00a4".

Java documentation for android.icu.util.ULocale.toUnicodeLocaleType(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to