From dev-return-38698-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Mon Dec 21 09:21:13 2009 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 16811 invoked from network); 21 Dec 2009 09:21:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 09:21:13 -0000 Received: (qmail 62612 invoked by uid 500); 21 Dec 2009 09:21:12 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 62532 invoked by uid 500); 21 Dec 2009 09:21:12 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 62521 invoked by uid 99); 21 Dec 2009 09:21:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 09:21:12 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xu.regis@gmail.com designates 209.85.216.183 as permitted sender) Received: from [209.85.216.183] (HELO mail-px0-f183.google.com) (209.85.216.183) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 09:21:03 +0000 Received: by pxi13 with SMTP id 13so3461017pxi.24 for ; Mon, 21 Dec 2009 01:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=lO4HZ5yaPY/wF2a0AY/lJEqo53iVGnt2XHP45Kj7yAA=; b=s10MuRmnqJxiBHZpncnVp4vk9XpfbzpEuErMifEK9zyXesnW1d9QRYywb7B4amX37e AMvLGqWfk6C8oSvRfgSPKnDTimSKrMqoxqZLhcQRB+APWOO3NwteAiir5c6ITCmXCbAL Xy+i/5ENfqhNMqguJvp9r/P2aUZ0CjKiPBCow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=OArmT/UKV4Ax9fg20CwMiGU/pnSbfvfJVd3U4ew+69qsjDV1S4oQ1VluwYCeQjCfxM dT0CNsVV4wXZgCcb95anO6kcSHoPnsILLR3v0Vd7z7T4HgftWMr80t4+lBk/oShBENfc v85qqkobSsUldmJJyW2syvv4PB/+XNA8ytpig= Received: by 10.143.138.7 with SMTP id q7mr4608963wfn.314.1261387243417; Mon, 21 Dec 2009 01:20:43 -0800 (PST) Received: from ?9.123.237.125? ([220.248.0.145]) by mx.google.com with ESMTPS id 21sm5092207pzk.11.2009.12.21.01.20.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Dec 2009 01:20:42 -0800 (PST) Message-ID: <4B2F3D86.1090805@gmail.com> Date: Mon, 21 Dec 2009 17:19:02 +0800 From: Regis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException References: <1235793198.1261382058096.JavaMail.jira@brutus> In-Reply-To: <1235793198.1261382058096.JavaMail.jira@brutus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2009-12-21 15:54, Ray Chen (JIRA) wrote: > > [ https://issues.apache.org/jira/browse/HARMONY-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793106#action_12793106 ] > > Ray Chen commented on HARMONY-6408: > ----------------------------------- > > Hi, > I have investigated this issue, found that if uses IBM vm, the default > encoding on my machine is GB18030 while using DRLVM it is GB2312. > I searched GB18030, found it on http://en.wikipedia.org/wiki/GB_18030 > which says GB2312 should be replaced with GB18030. > > The question is why different vm got different default file encoding? > It seems that System.ensureProperties() got the default file encoding, > in this function calls a static native method named "getEncoding()". > But I can not find this native funtion in my classlib working copy. > Does anyone know about this? Is this a classlib bug or vm bug? > > > > Do you mean the value of property "file.encoding"? It's set at modules/luni/src/main/native/luni/shared/luniglob.c:159 We first check whether the value is NULL, if so, call getOSCharset to get default value from OS ( you can reference HARMONY-6279 for more details). I guess IBM vm set the value to GB18030, but drlvm doesn't set it, and then we use getOSCharset, get a different charset. The charset should be same with your local setting. According to you previous comments on JIRA, seems GB2312 is correct. And I think we should fix the test not to depends on local environment. -- Best Regards, Regis.