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

An SQL string that contains a Kanji character is truncated at illegal positoin.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.2
    • core-libs



      Name: clC74495 Date: 12/22/99


      Symptom: An SQL string that contains a Kanji character is truncated at
      illegal position. It seems to me that the JdbcOdbcObject.CharsToBytes()
      method doesn't copy all converted characters into the byte array that is
      returned to the caller. The method copies the converted characters into the
      byte array by calling

      System.arraycopy(outBUf, 0, tRetBytes, retBytes.length,
      toBytes.nextCharIndex());.

      However, the System.arraycopy method copies only a part of characters if an
      SQL string contains a Kanji character, because the number of characters is
      specified as the number of bytes to be copied. Please remember that the some
      character encodings require multiple number of bytes for a character. For
      instance, the Shift JIS encoding requires two bytes for a Kanji character.
      (Review ID: 99237)
      ======================================================================

            jellissunw Jon Ellis (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: