ASF Bugzilla – Attachment 5797 Details for
Bug 18947
[PATCH]Some String values garble on different platforms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
PATCH to fix FooterRecord,HeaderRecord,BoundSheetRecord,and NameRecord
patch8.txt (text/plain), 3.77 KB, created by
Toshiaki Kamoshida
on 2003-04-11 10:43:38 UTC
(
hide
)
Description:
PATCH to fix FooterRecord,HeaderRecord,BoundSheetRecord,and NameRecord
Filename:
MIME Type:
Creator:
Toshiaki Kamoshida
Created:
2003-04-11 10:43:38 UTC
Size:
3.77 KB
patch
obsolete
>Index: BoundSheetRecord.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java,v >retrieving revision 1.6 >diff -a -r1.6 BoundSheetRecord.java >145c145 >< field_5_sheetname = new String( data, 8 + offset, nameLength ); >--- >> field_5_sheetname = StringUtil.getFromCompressedUnicode( data, 8 + offset, nameLength ); > >Index: FooterRecord.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/FooterRecord.java,v >retrieving revision 1.8 >diff -a -r1.8 FooterRecord.java >122c122 >< field_2_footer = new String(data, 3 + offset, // [Shawn] Changed 1 to 3 for offset of string >--- >> field_2_footer = StringUtil.getFromCompressedUnicode(data, 3 + offset, // [Shawn] Changed 1 to 3 for offset of string > >Index: HeaderRecord.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/HeaderRecord.java,v >retrieving revision 1.8 >diff -a -r1.8 HeaderRecord.java >122c122 >< field_2_header = new String(data, 3 + offset, // [Shawn] Changed 1 to 3 for offset of string >--- >> field_2_header = StringUtil.getFromCompressedUnicode(data, 3 + offset, // [Shawn] Changed 1 to 3 for offset of string > >Index: NameRecord.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/NameRecord.java,v >retrieving revision 1.9 >diff -a -r1.9 NameRecord.java >759c759 >< field_12_name_text = new String(data, 15 + offset, >--- >> field_12_name_text = StringUtil.getFromCompressedUnicode(data, 15 + offset, >767c767 >< field_14_custom_menu_text = new String(data, start_of_custom_menu_text + offset, >--- >> field_14_custom_menu_text = StringUtil.getFromCompressedUnicode(data, start_of_custom_menu_text + offset, >771c771 >< field_15_description_text = new String(data, start_of_description_text + offset, >--- >> field_15_description_text = StringUtil.getFromCompressedUnicode(data, start_of_description_text + offset, >775c775 >< field_16_help_topic_text = new String(data, start_of_help_topic_text + offset, >--- >> field_16_help_topic_text = StringUtil.getFromCompressedUnicode(data, start_of_help_topic_text + offset, >779c779 >< field_17_status_bar_text = new String(data, start_of_status_bar_text + offset, >--- >> field_17_status_bar_text = StringUtil.getFromCompressedUnicode(data, start_of_status_bar_text + offset, > > >Index: util/StringUtil.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/util/StringUtil.java,v >retrieving revision 1.8 >diff -a -r1.8 StringUtil.java > >198,199c198 >< >< >--- >> /** > * read compressed unicode(8bit) > * > * @author Toshiaki Kamoshida(kamoshida.toshiaki at future dot co dot jp) > * > * @param string byte array to read > * @param offset offset to read byte array > * @param len length to read byte array > * @return String generated String instance by reading byte array > */ > public static String getFromCompressedUnicode(final byte[] string, > final int offset, final int len){ > try{ > return new String(string,offset,len,"ISO-8859-1"); > } > catch(UnsupportedEncodingException e){ > throw new InternalError();/* unreachable */ > } > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18947
:
5795
| 5797 |
5923
|
5939