Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 57320 invoked from network); 14 Apr 2006 21:07:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Apr 2006 21:07:18 -0000 Received: (qmail 15594 invoked by uid 500); 14 Apr 2006 21:06:57 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 15229 invoked by uid 500); 14 Apr 2006 21:06:56 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 15215 invoked by uid 99); 14 Apr 2006 21:06:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2006 14:06:55 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2006 14:06:55 -0700 Received: from brutus (localhost.localdomain [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9432F7142A1 for ; Fri, 14 Apr 2006 21:06:02 +0000 (GMT) Message-ID: <68025464.1145048762605.JavaMail.jira@brutus> Date: Fri, 14 Apr 2006 21:06:02 +0000 (GMT+00:00) From: "Kathey Marsden (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-901) Remove use of String(byte[]) constructors in network server leading to non-portable behaviour In-Reply-To: <1900169969.1138741053043.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-901?page=comments#action_12374572 ] Kathey Marsden commented on DERBY-901: -------------------------------------- Hi Sunitha, Thank you for looking at the issue: I am having a bit of trouble with the repro. I am seeing i pass with and without the change. On the code changes. - I really like all the comments you added. - I am not sure if I understand the encoding implications of switching from the byte array to private static String SQLERRMC_TOKEN_DELIMITER = new String(new char[] {(char)20}); and what that means when it is converted to UTF-8 I am wondering if there is not some ascii delimter we could use, e.g. ^^ or somesuch. Whatever it is it can't be in the message strings themselves. - I still see one occurance of the byte[] in writeSQLDIAGCI(SQLException nextException) byte[] sep = {20}; // use it as separator of sqlerrmc tokens String separator = new String(sep); - Could we avoid the duplicate definitions of SQLERRMC_TOKEN_DELIMITER by having network server refer to the value in SystemProcedures? > Remove use of String(byte[]) constructors in network server leading to non-portable behaviour > --------------------------------------------------------------------------------------------- > > Key: DERBY-901 > URL: http://issues.apache.org/jira/browse/DERBY-901 > Project: Derby > Type: Bug > Components: Network Server > Reporter: Daniel John Debrunner > Assignee: Sunitha Kambhampati > Attachments: Derby901.p1.diff.txt, Derby901.p1.stat.txt, TestEnc.java > > These constructors use the Java default platform encoding to convert the bytes to a String, this typically leads to bugs on platforms with different encodings. > Replace with code using fixed conversion, or alternative mechanisms. > If the call is required its use should be commented as to why it is required. > org.apache.derby.impl.drda.DRDAConnThread > I generated this list using the Java search in eclipse for references to the constructors > String(byte[]) > String(byte[],int,int) - no occurences found in java/drda -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira