db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r393656 - in /db/derby/code/branches/10.1/java/client/org/apache/derby/client: am/Sqlca.java net/Typdef.java
Date Wed, 12 Apr 2006 23:27:54 GMT
Author: kmarsden
Date: Wed Apr 12 16:27:52 2006
New Revision: 393656

URL: http://svn.apache.org/viewcvs?rev=393656&view=rev
Log:
DERBY-900 Remove use of String(byte[]) and String(byte[], int, int) constructors in network
client leading to non-portable behaviour

-- use UTF8 encoding in bytes2String. 


Modified:
    db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Sqlca.java
    db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/Typdef.java

Modified: db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Sqlca.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Sqlca.java?rev=393656&r1=393655&r2=393656&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Sqlca.java (original)
+++ db/derby/code/branches/10.1/java/client/org/apache/derby/client/am/Sqlca.java Wed Apr
12 16:27:52 2006
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.client.net.Typdef;
+
 public abstract class Sqlca {
     transient protected Connection connection_;
     java.sql.SQLException exceptionThrownOnStoredProcInvocation_;
@@ -378,7 +380,8 @@
 
     private String bytes2String(byte[] bytes, int offset, int length)
             throws java.io.UnsupportedEncodingException {
-        return new String(bytes, offset, length);
+        // Network Server uses UTF-8 encoding
+        return new String(bytes, offset, length,Typdef.UTF8ENCODING);
     }
 
     public int getUpdateCount() {

Modified: db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/Typdef.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/Typdef.java?rev=393656&r1=393655&r2=393656&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/Typdef.java (original)
+++ db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/Typdef.java Wed Apr
12 16:27:52 2006
@@ -151,7 +151,7 @@
     // lob length
     static final short LOBLENGTH = 4;
 
-    static final String UTF8ENCODING = "UTF8";
+    public static final String UTF8ENCODING = "UTF8";
 
     private static final int OVERRIDE_TABLE_SIZE = 0xff;
 



Mime
View raw message