Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-683

Use correct encoding for ClobOutputStream on client

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.1.0, 10.1.2.1
    • Fix Version/s: 10.1.3.1, 10.2.1.6
    • Component/s: Network Client
    • Labels:
      None
    • Environment:
      all

      Description

      In client, there is code in ClobOutputStream which uses this api - new String(byte[]). Per the java api http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#String(byte[]) ,this will construct a string by decoding the array of bytes using the platform's default character set.

      org.apache.derby.client.am.ClobOutputStream is used for Clob.setAsciiStream and the write methods use the String(byte[]) which is incorrect because it will use the default platform encoding. Per the jdbcapi , this should use ascii encoding.

      In areas related to Clobs, also check for other places where String(byte[]) is used,as it may not be the desired behavior.

      Dan pointed this problem here : http://issues.apache.org/jira/browse/DERBY-463?page=comments#action_12356742

        Attachments

        1. ascii.txt
          0.1 kB
          Deepa
        2. clob.java
          4 kB
          Deepa
        3. derby-683.diff
          2 kB
          Deepa
        4. derby-683_tests.diff
          13 kB
          Deepa
        5. derby-683_tests.status
          0.7 kB
          Deepa
        6. derby-683_021006.stat
          0.7 kB
          Myrna van Lunteren
        7. derby-683_021006.diff
          14 kB
          Myrna van Lunteren
        8. DERBY-683_tstpatch3_2006_02_16.diff
          17 kB
          Myrna van Lunteren
        9. DERBY-683_tstpatch3_2006_02_16.stat
          0.7 kB
          Myrna van Lunteren

          Issue Links

            Activity

              People

              • Assignee:
                deepa Deepa
                Reporter:
                skambha Sunitha Kambhampati
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: