Bug 12843 - [PATCH] Make POI handle chinese better
Summary: [PATCH] Make POI handle chinese better
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: All All
: P1 critical with 10 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-20 08:08 UTC by jubeson
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
mainFunctionJava (22.47 KB, text/java)
2002-10-02 08:16 UTC, jubeson
Details
java file (3.55 KB, text/java)
2002-10-02 08:16 UTC, jubeson
Details
execl file (295.00 KB, app/excel)
2002-10-02 08:19 UTC, jubeson
Details
Similar but different kind of Exception, ArrayIndexOutOfBoundsException on SSTDeserializer.readStringRemainder() (47.00 KB, application/octet-stream)
2002-11-27 03:16 UTC, Paul Chung
Details
This is a solution. (22.66 KB, patch)
2002-12-10 02:57 UTC, qiuyiping
Details | Diff
a patch file (5.28 KB, patch)
2002-12-11 17:07 UTC, qiuyiping
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jubeson 2002-09-20 08:08:04 UTC
When I useed HSSF packages to parseing a execl file , it throws me some error , 
like follows 

java.lang.NegativeArraySizeException

	at org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder
(SSTDeserializer.java:335)

	at org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord
(SSTDeserializer.java:320)

	at org.apache.poi.hssf.record.SSTRecord.processContinueRecord
(SSTRecord.java:539)

	at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:216)

	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:151)

	at poitest.ExcelParser.<init>(ExcelParser.java:23)

	at poitest.runer.main(runer.java:44)
. 
I am sure this excel file is a formal and well excel file.But HSSF can't parse 
this file. Would you support some FTP for me to update this file to you!!!!!
Comment 1 Andy Oliver 2002-09-20 12:09:14 UTC
Please also try this with 1.8
http://jakarta.apache.org/builds/jakarta-poi/dev/bin/jakarta-poi-1.8.0-dev-bin.tar.gz

we recently had a number of internationalization fixes.

Please attach the files to this bug  (click "Create a new attachment"). 
Include: the file that is giving the problem and the minimum amount of code
possible to reproduce the error.  Label the format of any file attached (Java
class, Zip file, XLS, etc) because I hate to guess :-)

Thanks for assisting us in diagnosing this problem.
Comment 2 Andy Oliver 2002-10-01 21:26:58 UTC
If we don't get a reply within a week or so I'll close this.
Comment 3 jubeson 2002-10-02 08:16:19 UTC
Created attachment 3309 [details]
mainFunctionJava
Comment 4 jubeson 2002-10-02 08:16:50 UTC
Created attachment 3310 [details]
java file
Comment 5 jubeson 2002-10-02 08:19:29 UTC
Created attachment 3311 [details]
execl file
Comment 6 jubeson 2002-10-02 08:20:55 UTC
I tryed the newest poi packages you said , it is still has the error I describe 
before
Comment 7 Paul Chung 2002-11-27 03:16:53 UTC
Created attachment 3962 [details]
Similar but different kind of Exception, ArrayIndexOutOfBoundsException on SSTDeserializer.readStringRemainder()
Comment 8 Paul Chung 2002-11-27 03:20:24 UTC
Sometimes when I modify the file a bit, or copy and paste the content to a new 
workbook in Excel, the POI package could read the file again. 

However, I still couldn't figure out the rule to avoid the bug.
Comment 9 Paul Chung 2002-11-27 03:24:41 UTC
more detail stacktrace:

java.lang.ArrayIndexOutOfBoundsException
	at org.apache.poi.util.LittleEndian.putNumber(LittleEndian.java:550)
	at org.apache.poi.util.LittleEndian.putShort(LittleEndian.java:242)
	at org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder
(SSTDeserializer.java:339)
	at org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord
(SSTDeserializer.java:320)
	at org.apache.poi.hssf.record.SSTRecord.processContinueRecord
(SSTRecord.java:540)
	at org.apache.poi.hssf.record.RecordFactory.createRecords
(RecordFactory.java:210)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:140)
	at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>
(HSSFWorkbook.java:175)
Comment 10 Young Hoon, Park 2002-12-09 01:52:34 UTC
I'm undergoing same troubles and think it's critical, because I can't use it 
ever. I've done everything I could do(various version and step for long time), 
but failed. A quick reply would very much faciliate making application.
Comment 11 Paul Chung 2002-12-09 06:09:06 UTC
The same here. All my application implementation is done, just waiting for this 
bug to be fixed in order to roll out. Unfortunately I am not familiar with XLS 
binary format and couldn't provide any fix on it.
Comment 12 qiuyiping 2002-12-10 02:57:31 UTC
Created attachment 4098 [details]
This is a solution.
Comment 13 qiuyiping 2002-12-10 03:05:31 UTC
I'm in China and developing a software using POI.
This is my first bug about POI and had to change the source.
I think it's resolved.
When develpoing, I met many bugs about fareast String.
I'll reported later.
Comment 14 Andy Oliver 2002-12-10 16:25:28 UTC
Please resubmit against the HEAD in cvs per the instructions:
http://jakarta.apache.org/poi/getinvolved/index.html and then change the status
back to valid... 
Comment 15 qiuyiping 2002-12-11 17:07:59 UTC
Created attachment 4130 [details]
a patch file
Comment 16 Andy Oliver 2002-12-13 14:17:17 UTC
should have been reopened not resolved
Comment 17 Paul Chung 2002-12-22 05:22:48 UTC
Changed the Platform and OS categories of this bug to "ALL".
Comment 18 Andy Oliver 2003-07-24 13:29:31 UTC
Make POI handle chinese better
Comment 19 Shyamala Narasimhan 2003-08-14 18:36:49 UTC
hi
i am trying to parse a biiiig xls file with about 6000 rows and i get the 
following error 
java.lang.NegativeArraySizeException
        at org.apache.poi.hssf.record.SSTDeserializer.readStringRemainder(SSTDes
erializer.java:335)
        at org.apache.poi.hssf.record.SSTDeserializer.processContinueRecord(SSTD
eserializer.java:320)
        at org.apache.poi.hssf.record.SSTRecord.processContinueRecord(SSTRecord.
java:539)
        at org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.
java:218)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
91)
        at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:1
58)
        at com.om.client.ui.struts.action.pmf.supplierfeed.UploadProductListActi
on.perform(UploadProductListAction.java:101)
Comment 20 jubeson 2003-08-15 00:35:39 UTC
hi guys
Before I can use POI,I fixed three bug.I can't wait the Apache project to solve 
this problem.Because our project is time critial project.
Hope Apache can pay more attention to Chinese char(GB or Big5 encoding).
Comment 21 Andy Oliver 2003-08-15 00:54:22 UTC
Can someone create sufficient junit tests and update this patch against the REL_2_BRANCH.  What 
is lacking 
in our Chinese support is Chinese developers.  I think the last time I played with this patch it failed 
the unit tests.  
Comment 22 Avik Sengupta 2003-10-27 03:57:59 UTC
Fixed in CVS. Will go into next release - 2.0pre4

Testcases added with supplied excel files. Thanks.