Class CharsetCallback


  • public class CharsetCallback
    extends java.lang.Object

    Callback API for CharsetICU API

    CharsetCallback class defines some error behaviour functions called by CharsetDecoderICU and CharsetEncoderICU. The class also provides the facility by which clients can write their own callbacks. These functions, although public, should NEVER be called directly. They should be used as parameters to the onUmappableCharacter() and onMalformedInput() methods, to set the behaviour of a converter when it encounters UNMAPPED/INVALID sequences. Currently the only way to set callbacks is by using CodingErrorAction. In the future we will provide set methods on CharsetEncoder and CharsetDecoder that will accept CharsetCallback fields.
    • Constructor Detail

      • CharsetCallback

        private CharsetCallback()
    • Method Detail

      • IS_DEFAULT_IGNORABLE_CODE_POINT

        private static boolean IS_DEFAULT_IGNORABLE_CODE_POINT​(int c)
      • itou

        private static final int itou​(char[] buffer,
                                      int sourceIndex,
                                      int i,
                                      int radix,
                                      int minwidth)
        Java port of uprv_itou() in ICU4C used by TO_U_CALLBACK_ESCAPE and FROM_U_CALLBACK_ESCAPE. Fills in a char string with the radix-based representation of a number padded with zeroes to minwidth.