harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regis <xu.re...@gmail.com>
Subject Re: [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
Date Mon, 21 Dec 2009 09:19:02 GMT
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 

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,

View raw message