Bug 49273

Summary: Font.getCharSet return byte is error
Product: POI Reporter: longxibo
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.6-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: It is have GB2312 charact set

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.