harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6408) [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
Date Mon, 21 Dec 2009 07:54:18 GMT

    [ 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?




-- 
Regards,

Ray Chen


> [classlib][luni]OutputStreamWriterTest got java.nio.BufferOverflowException
> ---------------------------------------------------------------------------
>
>                 Key: HARMONY-6408
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6408
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Ray Chen
>
> Following is the exception trace:
> java.nio.BufferOverflowException
> java.nio.charset.CoderMalfunctionError: java.nio.BufferOverflowException
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:450)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> at java.io.OutputStreamWriter.write(OutputStreamWriter.java:232)
> at java.io.Writer.write(Writer.java:98)
> at org.apache.harmony.luni.tests.java.io.OutputStreamWriterTest.testHandleEarlyEOFChar_1(OutputStreamWriterTest.java:416)
> at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
> Caused by: java.nio.BufferOverflowException
> at java.nio.ReadWriteHeapByteBuffer.put(ReadWriteHeapByteBuffer.java:97)
> at org.apache.harmony.niochar.charset.additional.GB2312$Encoder.encodeLoop(GB2312.java:297)
> at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:448)
> at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:237)
> In OutputStreamWriter's constructor using the default character encoding, on my machine,
it is GB2312. 
> If I set the encoder to "ISO8859_1" the test passed.
> So I think most of the members from China will got this error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message