CharsetEncoder.CanEncode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CanEncode(ICharSequence) |
Tells whether or not this encoder can encode the given character sequence. |
CanEncode(Char) |
Tells whether or not this encoder can encode the given character. |
CanEncode(String) |
Tells whether or not this encoder can encode the given character sequence. |
CanEncode(ICharSequence)
Tells whether or not this encoder can encode the given character sequence.
[Android.Runtime.Register("canEncode", "(Ljava/lang/CharSequence;)Z", "GetCanEncode_Ljava_lang_CharSequence_Handler")]
public virtual bool CanEncode (Java.Lang.ICharSequence? cs);
[<Android.Runtime.Register("canEncode", "(Ljava/lang/CharSequence;)Z", "GetCanEncode_Ljava_lang_CharSequence_Handler")>]
abstract member CanEncode : Java.Lang.ICharSequence -> bool
override this.CanEncode : Java.Lang.ICharSequence -> bool
Parameters
The given character sequence
Returns
true
if, and only if, this encoder can encode
the given character without throwing any exceptions and without
performing any replacements
- Attributes
Exceptions
if another encode process is ongoing.
Remarks
Tells whether or not this encoder can encode the given character sequence.
If this method returns false
for a particular character sequence then more information about why the sequence cannot be encoded may be obtained by performing a full encoding operation.
This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.
The default implementation of this method is not very efficient; it should generally be overridden to improve performance.
Java documentation for java.nio.charset.CharsetEncoder.canEncode(java.lang.CharSequence)
.
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
CanEncode(Char)
Tells whether or not this encoder can encode the given character.
[Android.Runtime.Register("canEncode", "(C)Z", "GetCanEncode_CHandler")]
public virtual bool CanEncode (char c);
[<Android.Runtime.Register("canEncode", "(C)Z", "GetCanEncode_CHandler")>]
abstract member CanEncode : char -> bool
override this.CanEncode : char -> bool
Parameters
- c
- Char
The given character
Returns
true
if, and only if, this encoder can encode
the given character
- Attributes
Exceptions
if another encode process is ongoing.
Remarks
Tells whether or not this encoder can encode the given character.
This method returns false
if the given character is a surrogate character; such characters can be interpreted only when they are members of a pair consisting of a high surrogate followed by a low surrogate. The #canEncode(java.lang.CharSequence) canEncode(CharSequence)
method may be used to test whether or not a character sequence can be encoded.
This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.
The default implementation of this method is not very efficient; it should generally be overridden to improve performance.
Java documentation for java.nio.charset.CharsetEncoder.canEncode(char)
.
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
CanEncode(String)
Tells whether or not this encoder can encode the given character sequence.
public bool CanEncode (string? cs);
member this.CanEncode : string -> bool
Parameters
- cs
- String
The given character sequence
Returns
true
if, and only if, this encoder can encode
the given character without throwing any exceptions and without
performing any replacements
Remarks
Tells whether or not this encoder can encode the given character sequence.
If this method returns false
for a particular character sequence then more information about why the sequence cannot be encoded may be obtained by performing a full encoding operation.
This method may modify this encoder's state; it should therefore not be invoked if an encoding operation is already in progress.
The default implementation of this method is not very efficient; it should generally be overridden to improve performance.
Java documentation for java.nio.charset.CharsetEncoder.canEncode(java.lang.CharSequence)
.
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.