Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4514837

ChartoByteUnicode needs correct canConvert(char) implementation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.4.0, 1.4.2
    • core-libs

      The problem has been there for years, it's not merlin specific.
      Currently CharToByteUnicode inherits the canConvert(char) from it's
      parent class CharToByteConverter, which hardcodes the output byte
      buffer length to "3" before calling "convert() to test if the input
      "char" is acceptable by the converter or not, in case of Unicode,
      we need to write out 2 bytes of "unicode byte order mark" first by
      default, which causes the "canConverter" method totally useless.
      One example is to use native2ascii -reverse -encoding UTF16, it
      doesn't convert the \udddd unocide noataion to real unicode correctly.

            ilittlesunw Ian Little (Inactive)
            sherman Xueming Shen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: