次の方法で共有


Charset.AvailableCharsets Method

Definition

Constructs a sorted map from canonical charset names to charset objects.

[Android.Runtime.Register("availableCharsets", "()Ljava/util/SortedMap;", "")]
public static System.Collections.Generic.IDictionary<string,Java.Nio.Charset.Charset>? AvailableCharsets ();
[<Android.Runtime.Register("availableCharsets", "()Ljava/util/SortedMap;", "")>]
static member AvailableCharsets : unit -> System.Collections.Generic.IDictionary<string, Java.Nio.Charset.Charset>

Returns

An immutable, case-insensitive map from canonical charset names to charset objects

Attributes

Remarks

Constructs a sorted map from canonical charset names to charset objects.

The map returned by this method will have one entry for each charset for which support is available in the current Java virtual machine. If two or more supported charsets have the same canonical name then the resulting map will contain just one of them; which one it will contain is not specified.

The invocation of this method, and the subsequent use of the resulting map, may cause time-consuming disk or network I/O operations to occur. This method is provided for applications that need to enumerate all of the available charsets, for example to allow user charset selection. This method is not used by the #forName forName method, which instead employs an efficient incremental lookup algorithm.

This method may return different results at different times if new charset providers are dynamically made available to the current Java virtual machine. In the absence of such changes, the charsets returned by this method are exactly those that can be retrieved via the #forName forName method.

Java documentation for java.nio.charset.Charset.availableCharsets().

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