Steps to reproduce:
Extract the attached gbtest.java
compile with jdk1.4.1_05 on Solaris 9
Set CDE locale to zh_CN.GB18030
run java gbtest text.out.gb18030 count.out /tmp/xxx
run diff text.out.gb18030 /tmp/xxx
Perform same steps in C locale and you will see the input and output files are identitcal.The attached program reads a file in GB18030 encoding and writes in GB18030 encoding. During the round trip few characters are lost if the program is run in zh_CN.GB18030 locale and works correctly if it is run C locale