Share via


Charset.CanEncode Method

Definition

Tells whether or not this charset supports encoding.

[Android.Runtime.Register("canEncode", "()Z", "GetCanEncodeHandler")]
public virtual bool CanEncode ();
[<Android.Runtime.Register("canEncode", "()Z", "GetCanEncodeHandler")>]
abstract member CanEncode : unit -> bool
override this.CanEncode : unit -> bool

Returns

true if, and only if, this charset supports encoding

Attributes

Remarks

Tells whether or not this charset supports encoding.

Nearly all charsets support encoding. The primary exceptions are special-purpose auto-detect charsets whose decoders can determine which of several possible encoding schemes is in use by examining the input byte sequence. Such charsets do not support encoding because there is no way to determine which encoding should be used on output. Implementations of such charsets should override this method to return false.

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

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