poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toshiaki Kamoshida <tk...@hh.iij4u.or.jp>
Subject Re: sheet names and string format read garbled on EBCDIC machine
Date Wed, 09 Apr 2003 15:53:54 GMT

On Wed, 09 Apr 2003 08:27:52 -0400
"Andrew C. Oliver" <acoliver@apache.org> wrote:

> Toshiaki Kamoshida wrote:
> 
> >If you can,there is a way to avoid to be worried about the problem,
> >
> >1.Serach all phrases
> >  "new String(byte[])"or
> >  "new String(byte[],int offset,int size)"
> >
> >2.Replace thease phrases to "new String(args,"ISO-8859-1")"
> >  
> >
> yes.  This is what I did before everywhere that I found it.  If you find 
> other places that it should be done, please submit patches/unit tests/etc.
> 

I tried grep with regexp"new[\t\n\x0B\f\r]*String[\t\n\x0B\f\r]*[(]"
in hssf package,and found them.Does this help you?

record\BoundSheetRecord.java(145):             field_5_sheetname = new String(
data, 8 + offset, nameLength );
record\FontRecord.java(167):                 field_11_font_name = new String(data, 16,
record\FooterRecord.java(122):             field_2_footer     = new String(data, 3 + offset,
// [Shawn] Changed 1 to 3 for offset of string
record\FormatRecord.java(135):           field_4_formatstring = new String(data, 5 + offset,
field_3_unicode_len );
record\HeaderRecord.java(122):             field_2_header     = new String(data, 3 + offset,
// [Shawn] Changed 1 to 3 for offset of string
record\LabelRecord.java(160):             field_6_value = new String(data, 9 + offset, getStringLength());
record\NameRecord.java(759):             field_12_name_text = new String(data, 15 + offset,
record\NameRecord.java(767):             field_14_custom_menu_text       = new String(data,
start_of_custom_menu_text + offset,
record\NameRecord.java(771):             field_15_description_text       = new String(data,
start_of_description_text + offset,
record\NameRecord.java(775):             field_16_help_topic_text        = new String(data,
start_of_help_topic_text + offset,
record\NameRecord.java(779):             field_17_status_bar_text        = new String(data,
start_of_status_bar_text +  offset,
record\StringRecord.java(137):             field_3_string = new String(data, 3 + offset, field_1_string_length);
record\StyleRecord.java(137):             field_3_name        = new String(data, 3 + offset,
record\UnicodeString.java(154):                 field_3_string = new String(data, 3, getCharCount(),
record\UnicodeString.java(172):             field_3_string = new String(array);
record\UnicodeString.java(303):             String unicodeString = new String(getString().getBytes("Unicode"),"Unicode");
record\WriteAccessRecord.java(118):         field_1_username = new String(data, 3 + offset,
data.length - 4);
record\formula\StringPtg.java(82):         setValue(new String(data, offset+3, data[offset+1]
+ 256*data[offset+2]));

> >I feel,the place using phrases like 1,you expect that byte array
> >contains "ISO-8859-1"(1 char always consumes only 1byte and the 
> >charset is Latin-1),and if you must parse byte array as 16Bit 
> >Unicode,always you must use StringUtil.
> >And I feel,if the changes like this causes some problems,it is
> >the bug"the place doesn't support i18n" from the beginning.
> >  
> >
> yes/no  we should support i18n. 

OK,of course,if a bug appears we must fix it:D

> >But,can you change sources without appearing sickness?
> >Is the way "too rough"?
> >  
> >
> This is opensource.  We can always patch.  I don't worry about appearences.

OK,I understand.

> -Andy
> 
(omit)

Thanks.

Toshiaki Kamoshida


Mime
View raw message