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.