Class CharsetEncoderICU

java.lang.Object
java.nio.charset.CharsetEncoder
com.adobe.agl.charset.CharsetEncoderICU

public abstract class CharsetEncoderICU extends CharsetEncoder
An abstract class that provides framework methods of decoding operations for concrete subclasses. In the future this class will contain API that will implement converter semantics of ICU4C.
  • Method Details

    • isFallbackUsed

      public boolean isFallbackUsed()
      Is this Encoder allowed to use fallbacks? A fallback mapping is a mapping that will convert a Unicode codepoint sequence to a byte sequence, but the encoded byte sequence will round trip convert to a different Unicode codepoint sequence.
      Returns:
      true if the converter uses fallback, false otherwise.
    • setFallbackUsed

      public void setFallbackUsed(boolean usesFallback)
      Sets whether this Encoder can use fallbacks?
      Parameters:
      usesFallback - true if the user wants the converter to take advantage of the fallback mapping, false otherwise.
    • setFromUContext

      public final void setFromUContext(Object newContext)
      Sets fromUContext used in callbacks.
      Parameters:
      newContext - Object
      Throws:
      IllegalArgumentException
    • canEncode

      public boolean canEncode(int[] codepoint)
      Parameters:
      codepoint - Unicode code point as int array
      Returns:
      true if the input sequence can be converted
    • isLegalReplacement

      public boolean isLegalReplacement(byte[] repl)
      Overrides super class method
      Overrides:
      isLegalReplacement in class CharsetEncoder