Bug 49273 - Font.getCharSet return byte is error
Font.getCharSet return byte is error
Status: RESOLVED FIXED
Product: POI
Classification: Unclassified
Component: XSSF
3.6-FINAL
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: POI Developers List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-05-12 03:22 UTC by longxibo
Modified: 2010-05-25 12:26 UTC (History)
0 users



Attachments
It is have GB2312 charact set (10.80 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2010-05-13 03:42 UTC, longxibo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description longxibo 2010-05-12 03:22:24 UTC
Sample XSSFont.getCharSet:
public byte getCharSet() {
        CTIntProperty charset = _ctFont.sizeOfCharsetArray() == 0 ? null : _ctFont.getCharsetArray(0);
        int val = charset == null ? FontCharset.ANSI.getValue() : FontCharset.valueOf(charset.getVal()).getValue();
        return (byte)val;
    }
//When val great 127,then (byte)val is negative!
//So return type is should change to int
Comment 1 Nick Burch 2010-05-12 06:53:12 UTC
Any chance you could upload a file with a character set outside the 0-127 range? That can then be used as part of a unit test for the change.
Comment 2 longxibo 2010-05-13 02:43:14 UTC
(In reply to comment #1)
> Any chance you could upload a file with a character set outside the 0-127
> range? That can then be used as part of a unit test for the change.

ok,I upload a xlsx file.When character set  is GB2312(character set value is 134),Scene is occur!
Comment 3 longxibo 2010-05-13 03:42:09 UTC
Created attachment 25434 [details]
It is have GB2312 charact set
Comment 4 Nick Burch 2010-05-25 12:26:06 UTC
Thanks for the sample file. Fix and unit test added in r948089.