ASF Bugzilla – Attachment 2422 Details for
Bug 10548
[PATCH] Unicode Support for excel sheetname.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
The code for fixing unicode sheet name and unittests for it.
patch_for_unicode_sheet_name.patch (text/plain), 44.73 KB, created by
Sergei Kozello
on 2002-07-20 22:42:37 UTC
(
hide
)
Description:
The code for fixing unicode sheet name and unittests for it.
Filename:
MIME Type:
Creator:
Sergei Kozello
Created:
2002-07-20 22:42:37 UTC
Size:
44.73 KB
patch
obsolete
>? .classpath >? .project >? mypatch.patch >? report >? build/classes >? build/contrib >? build/docs >? build/examples >? build/jakarta-poi-1.8.0-dev-20020721.jar >? build/jakarta-poi-contrib-1.8.0-dev-20020721.jar >? build/jakarta-poi-examples-1.8.0-dev-20020721.jar >? build/jakarta-poi-scratchpad-1.8.0-dev-20020721.jar >? build/java >? build/scratchpad >? build/testcases >? build/work >? src/documentation/xdocs/hssf/report >? src/java/org/apache/poi/hssf/model/FormulaParser.class >? src/java/org/apache/poi/hssf/model/Node.class >? src/java/org/apache/poi/hssf/model/Sheet.class >? src/java/org/apache/poi/hssf/model/Workbook.class >? src/java/org/apache/poi/hssf/record/BOFRecord.class >? src/java/org/apache/poi/hssf/record/BackupRecord.class >? src/java/org/apache/poi/hssf/record/BlankRecord.class >? src/java/org/apache/poi/hssf/record/BookBoolRecord.class >? src/java/org/apache/poi/hssf/record/BoolErrRecord.class >? src/java/org/apache/poi/hssf/record/BoundSheetRecord.class >? src/java/org/apache/poi/hssf/record/CalcCountRecord.class >? src/java/org/apache/poi/hssf/record/CalcModeRecord.class >? src/java/org/apache/poi/hssf/record/CellValueRecordInterface.class >? src/java/org/apache/poi/hssf/record/CodepageRecord.class >? src/java/org/apache/poi/hssf/record/ColumnInfoRecord.class >? src/java/org/apache/poi/hssf/record/ContinueRecord.class >? src/java/org/apache/poi/hssf/record/CountryRecord.class >? src/java/org/apache/poi/hssf/record/DBCellRecord.class >? src/java/org/apache/poi/hssf/record/DSFRecord.class >? src/java/org/apache/poi/hssf/record/DateWindow1904Record.class >? src/java/org/apache/poi/hssf/record/DefaultColWidthRecord.class >? src/java/org/apache/poi/hssf/record/DefaultRowHeightRecord.class >? src/java/org/apache/poi/hssf/record/DeltaRecord.class >? src/java/org/apache/poi/hssf/record/DimensionsRecord.class >? src/java/org/apache/poi/hssf/record/EOFRecord.class >? src/java/org/apache/poi/hssf/record/ExtSSTInfoSubRecord.class >? src/java/org/apache/poi/hssf/record/ExtSSTRecord.class >? src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.class >? src/java/org/apache/poi/hssf/record/ExternSheetRecord.class >? src/java/org/apache/poi/hssf/record/ExternSheetSubRecord.class >? src/java/org/apache/poi/hssf/record/FnGroupCountRecord.class >? src/java/org/apache/poi/hssf/record/FontRecord.class >? src/java/org/apache/poi/hssf/record/FooterRecord.class >? src/java/org/apache/poi/hssf/record/FormatRecord.class >? src/java/org/apache/poi/hssf/record/FormulaRecord.class >? src/java/org/apache/poi/hssf/record/GridsetRecord.class >? src/java/org/apache/poi/hssf/record/GutsRecord.class >? src/java/org/apache/poi/hssf/record/HCenterRecord.class >? src/java/org/apache/poi/hssf/record/HeaderRecord.class >? src/java/org/apache/poi/hssf/record/HideObjRecord.class >? src/java/org/apache/poi/hssf/record/IndexRecord.class >? src/java/org/apache/poi/hssf/record/InterfaceEndRecord.class >? src/java/org/apache/poi/hssf/record/InterfaceHdrRecord.class >? src/java/org/apache/poi/hssf/record/IterationRecord.class >? src/java/org/apache/poi/hssf/record/LabelRecord.class >? src/java/org/apache/poi/hssf/record/LabelSSTRecord.class >? src/java/org/apache/poi/hssf/record/MMSRecord.class >? src/java/org/apache/poi/hssf/record/MergeCellsRecord$MergedRegion.class >? src/java/org/apache/poi/hssf/record/MergeCellsRecord.class >? src/java/org/apache/poi/hssf/record/MulBlankRecord.class >? src/java/org/apache/poi/hssf/record/MulRKRecord.class >? src/java/org/apache/poi/hssf/record/NameRecord.class >? src/java/org/apache/poi/hssf/record/NumberRecord.class >? src/java/org/apache/poi/hssf/record/PasswordRecord.class >? src/java/org/apache/poi/hssf/record/PasswordRev4Record.class >? src/java/org/apache/poi/hssf/record/PrecisionRecord.class >? src/java/org/apache/poi/hssf/record/PrintGridlinesRecord.class >? src/java/org/apache/poi/hssf/record/PrintHeadersRecord.class >? src/java/org/apache/poi/hssf/record/PrintSetupRecord.class >? src/java/org/apache/poi/hssf/record/ProtectRecord.class >? src/java/org/apache/poi/hssf/record/ProtectionRev4Record.class >? src/java/org/apache/poi/hssf/record/RKRecord.class >? src/java/org/apache/poi/hssf/record/Record.class >? src/java/org/apache/poi/hssf/record/RecordFactory.class >? src/java/org/apache/poi/hssf/record/RecordFormatException.class >? src/java/org/apache/poi/hssf/record/RecordProcessor.class >? src/java/org/apache/poi/hssf/record/RefModeRecord.class >? src/java/org/apache/poi/hssf/record/RefreshAllRecord.class >? src/java/org/apache/poi/hssf/record/RkRec.class >? src/java/org/apache/poi/hssf/record/RowRecord.class >? src/java/org/apache/poi/hssf/record/SSTDeserializer.class >? src/java/org/apache/poi/hssf/record/SSTRecord.class >? src/java/org/apache/poi/hssf/record/SSTRecordHeader.class >? src/java/org/apache/poi/hssf/record/SSTRecordSizeCalculator.class >? src/java/org/apache/poi/hssf/record/SSTSerializer.class >? src/java/org/apache/poi/hssf/record/SaveRecalcRecord.class >? src/java/org/apache/poi/hssf/record/SelectionRecord.class >? src/java/org/apache/poi/hssf/record/StyleRecord.class >? src/java/org/apache/poi/hssf/record/SupBookRecord.class >? src/java/org/apache/poi/hssf/record/TabIdRecord.class >? src/java/org/apache/poi/hssf/record/UnicodeString.class >? src/java/org/apache/poi/hssf/record/UnknownRecord.class >? src/java/org/apache/poi/hssf/record/UseSelFSRecord.class >? src/java/org/apache/poi/hssf/record/VCenterRecord.class >? src/java/org/apache/poi/hssf/record/WSBoolRecord.class >? src/java/org/apache/poi/hssf/record/WindowOneRecord.class >? src/java/org/apache/poi/hssf/record/WindowProtectRecord.class >? src/java/org/apache/poi/hssf/record/WindowTwoRecord.class >? src/java/org/apache/poi/hssf/record/WriteAccessRecord.class >? src/java/org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.class >? src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.class >? src/java/org/apache/poi/hssf/record/formula/AbstractFunctionPtg.class >? src/java/org/apache/poi/hssf/record/formula/AddPtg.class >? src/java/org/apache/poi/hssf/record/formula/Area3DPtg.class >? src/java/org/apache/poi/hssf/record/formula/AreaPtg.class >? src/java/org/apache/poi/hssf/record/formula/AttrPtg.class >? src/java/org/apache/poi/hssf/record/formula/ConcatPtg.class >? src/java/org/apache/poi/hssf/record/formula/DividePtg.class >? src/java/org/apache/poi/hssf/record/formula/ExpPtg.class >? src/java/org/apache/poi/hssf/record/formula/FuncPtg.class >? src/java/org/apache/poi/hssf/record/formula/FuncVarPtg.class >? src/java/org/apache/poi/hssf/record/formula/IntPtg.class >? src/java/org/apache/poi/hssf/record/formula/MemErrPtg.class >? src/java/org/apache/poi/hssf/record/formula/MissingArgPtg.class >? src/java/org/apache/poi/hssf/record/formula/MultiplyPtg.class >? src/java/org/apache/poi/hssf/record/formula/NamePtg.class >? src/java/org/apache/poi/hssf/record/formula/NumberPtg.class >? src/java/org/apache/poi/hssf/record/formula/OperationPtg.class >? src/java/org/apache/poi/hssf/record/formula/ParenthesisPtg.class >? src/java/org/apache/poi/hssf/record/formula/PowerPtg.class >? src/java/org/apache/poi/hssf/record/formula/Ptg.class >? src/java/org/apache/poi/hssf/record/formula/Ref3DPtg.class >? src/java/org/apache/poi/hssf/record/formula/ReferencePtg.class >? src/java/org/apache/poi/hssf/record/formula/StringPtg.class >? src/java/org/apache/poi/hssf/record/formula/SubtractPtg.class >? src/java/org/apache/poi/hssf/usermodel/HSSFCell.class >? src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.class >? src/java/org/apache/poi/hssf/usermodel/HSSFDateUtil.class >? src/java/org/apache/poi/hssf/usermodel/HSSFFont.class >? src/java/org/apache/poi/hssf/usermodel/HSSFFooter.class >? src/java/org/apache/poi/hssf/usermodel/HSSFHeader.class >? src/java/org/apache/poi/hssf/usermodel/HSSFName.class >? src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.class >? src/java/org/apache/poi/hssf/usermodel/HSSFRow.class >? src/java/org/apache/poi/hssf/usermodel/HSSFSheet.class >? src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.class >? src/java/org/apache/poi/hssf/util/AreaReference.class >? src/java/org/apache/poi/hssf/util/CellReference.class >? src/java/org/apache/poi/hssf/util/RKUtil.class >? src/java/org/apache/poi/hssf/util/RangeAddress.class >? src/java/org/apache/poi/hssf/util/Region.class >? src/java/org/apache/poi/hssf/util/SheetReferences.class >? src/java/org/apache/poi/poifs/common/POIFSConstants.class >? src/java/org/apache/poi/poifs/dev/POIFSViewable.class >? src/java/org/apache/poi/poifs/filesystem/BATManaged.class >? src/java/org/apache/poi/poifs/filesystem/DirectoryEntry.class >? src/java/org/apache/poi/poifs/filesystem/DirectoryNode.class >? src/java/org/apache/poi/poifs/filesystem/DocumentEntry.class >? src/java/org/apache/poi/poifs/filesystem/DocumentInputStream.class >? src/java/org/apache/poi/poifs/filesystem/DocumentNode.class >? src/java/org/apache/poi/poifs/filesystem/DocumentOutputStream.class >? src/java/org/apache/poi/poifs/filesystem/Entry.class >? src/java/org/apache/poi/poifs/filesystem/EntryNode.class >? src/java/org/apache/poi/poifs/filesystem/POIFSDocument$BigBlockStore.class >? src/java/org/apache/poi/poifs/filesystem/POIFSDocument$SmallBlockStore.class >? src/java/org/apache/poi/poifs/filesystem/POIFSDocument.class >? src/java/org/apache/poi/poifs/filesystem/POIFSDocumentPath.class >? src/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.class >? src/java/org/apache/poi/poifs/filesystem/POIFSWriterEvent.class >? src/java/org/apache/poi/poifs/filesystem/POIFSWriterListener.class >? src/java/org/apache/poi/poifs/property/Child.class >? src/java/org/apache/poi/poifs/property/DirectoryProperty$1.class >? src/java/org/apache/poi/poifs/property/DirectoryProperty$PropertyComparator.class >? src/java/org/apache/poi/poifs/property/DirectoryProperty.class >? src/java/org/apache/poi/poifs/property/DocumentProperty.class >? src/java/org/apache/poi/poifs/property/Parent.class >? src/java/org/apache/poi/poifs/property/Property.class >? src/java/org/apache/poi/poifs/property/PropertyConstants.class >? src/java/org/apache/poi/poifs/property/PropertyFactory.class >? src/java/org/apache/poi/poifs/property/PropertyTable.class >? src/java/org/apache/poi/poifs/property/RootProperty.class >? src/java/org/apache/poi/poifs/storage/BATBlock.class >? src/java/org/apache/poi/poifs/storage/BigBlock.class >? src/java/org/apache/poi/poifs/storage/BlockAllocationTableReader.class >? src/java/org/apache/poi/poifs/storage/BlockAllocationTableWriter.class >? src/java/org/apache/poi/poifs/storage/BlockList.class >? src/java/org/apache/poi/poifs/storage/BlockListImpl.class >? src/java/org/apache/poi/poifs/storage/BlockWritable.class >? src/java/org/apache/poi/poifs/storage/DocumentBlock.class >? src/java/org/apache/poi/poifs/storage/HeaderBlockConstants.class >? src/java/org/apache/poi/poifs/storage/HeaderBlockReader.class >? src/java/org/apache/poi/poifs/storage/HeaderBlockWriter.class >? src/java/org/apache/poi/poifs/storage/ListManagedBlock.class >? src/java/org/apache/poi/poifs/storage/PropertyBlock$1.class >? src/java/org/apache/poi/poifs/storage/PropertyBlock.class >? src/java/org/apache/poi/poifs/storage/RawDataBlock.class >? src/java/org/apache/poi/poifs/storage/RawDataBlockList.class >? src/java/org/apache/poi/poifs/storage/SmallBlockTableReader.class >? src/java/org/apache/poi/poifs/storage/SmallBlockTableWriter.class >? src/java/org/apache/poi/poifs/storage/SmallDocumentBlock.class >? src/java/org/apache/poi/poifs/storage/SmallDocumentBlockList.class >? src/java/org/apache/poi/util/BinaryTree$1.class >? src/java/org/apache/poi/util/BinaryTree$10.class >? src/java/org/apache/poi/util/BinaryTree$11.class >? src/java/org/apache/poi/util/BinaryTree$12.class >? src/java/org/apache/poi/util/BinaryTree$2.class >? src/java/org/apache/poi/util/BinaryTree$3.class >? src/java/org/apache/poi/util/BinaryTree$4.class >? src/java/org/apache/poi/util/BinaryTree$5.class >? src/java/org/apache/poi/util/BinaryTree$6.class >? src/java/org/apache/poi/util/BinaryTree$7.class >? src/java/org/apache/poi/util/BinaryTree$8.class >? src/java/org/apache/poi/util/BinaryTree$9.class >? src/java/org/apache/poi/util/BinaryTree$BinaryTreeIterator.class >? src/java/org/apache/poi/util/BinaryTree$Node.class >? src/java/org/apache/poi/util/BinaryTree.class >? src/java/org/apache/poi/util/BitField.class >? src/java/org/apache/poi/util/ByteField.class >? src/java/org/apache/poi/util/FixedField.class >? src/java/org/apache/poi/util/HexDump.class >? src/java/org/apache/poi/util/IntList.class >? src/java/org/apache/poi/util/IntegerField.class >? src/java/org/apache/poi/util/LittleEndian$BufferUnderrunException.class >? src/java/org/apache/poi/util/LittleEndian.class >? src/java/org/apache/poi/util/LittleEndianConsts.class >? src/java/org/apache/poi/util/LongField.class >? src/java/org/apache/poi/util/NullLogger.class >? src/java/org/apache/poi/util/POILogFactory.class >? src/java/org/apache/poi/util/POILogger.class >? src/java/org/apache/poi/util/ShortField.class >? src/java/org/apache/poi/util/StringUtil.class >? src/testcases/org/apache/poi/hssf/record/NameListener.java >? src/testcases/org/apache/poi/hssf/record/TestBoundSheetRecord.java >? tools/cents/forrest.cent/legal >? tools/cents/forrest.cent/tasks.properties >? tools/cents/forrest.cent/xbuild.xml >? tools/cents/forrest.cent/conf/cocoon.xconf >? tools/cents/forrest.cent/conf/sitemap.xmap >? tools/cents/forrest.cent/lib/avalon-excalibur-4.1.jar >? tools/cents/forrest.cent/lib/avalon-framework-4.1.2.jar >? tools/cents/forrest.cent/lib/avalon-scratchpad-20020212.jar >? tools/cents/forrest.cent/lib/cocoon-scratchpad-part.jar >? tools/cents/forrest.cent/lib/cocoon.jar >? tools/cents/forrest.cent/lib/commons-collections-1.0.jar >? tools/cents/forrest.cent/lib/commons-httpclient-20011012.jar >? tools/cents/forrest.cent/lib/jakarta-regexp-1.2.jar >? tools/cents/forrest.cent/lib/logkit-1.0.1.jar >? tools/cents/forrest.cent/lib/resolver-20020130.jar >? tools/cents/forrest.cent/resources/library/xslt/changes2document.xsl >? tools/cents/forrest.cent/resources/library/xslt/copyover.xsl >? tools/cents/forrest.cent/resources/library/xslt/doclist.xsl >? tools/cents/forrest.cent/resources/library/xslt/doclist2document.xsl >? tools/cents/forrest.cent/resources/library/xslt/faq2document.xsl >? tools/cents/forrest.cent/resources/library/xslt/filterlinks.xsl >? tools/cents/forrest.cent/resources/library/xslt/todo2document.xsl >? tools/cents/forrest.cent/resources/resources/images >? tools/cents/forrest.cent/resources/resources/schema/CatalogManager.properties >? tools/cents/forrest.cent/resources/resources/schema/README >? tools/cents/forrest.cent/resources/resources/schema/catalog >? tools/cents/forrest.cent/resources/resources/schema/catalog.xcat >? tools/cents/forrest.cent/resources/resources/schema/dtd/book-cocoon-v10.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/changes-v11.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/document-v11.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/faq-v11.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/javadoc-v04draft.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/project.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/specification-v11.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/todo-v11.dtd >? tools/cents/forrest.cent/resources/resources/schema/dtd/xgump.dtd >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOdia.pen >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOgrk1.pen >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOlat1.pen >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOnum.pen >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOpub.pen >? tools/cents/forrest.cent/resources/resources/schema/entity/ISOtech.pen >? tools/cents/forrest.cent/resources/skins/avalon-site >? tools/cents/forrest.cent/resources/skins/basic >? tools/cents/forrest.cent/resources/skins/forrest-site >? tools/cents/forrest.cent/resources/skins/scarab-site2 >? tools/cents/forrest.cent/resources/skins/xml-apache-site >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/add.jpg >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/ant_logo_medium.gif >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/built-with-cocoon.gif >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/favicon.ico >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/krysalis-compatible.jpg >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/note.gif >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/remove.jpg >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/update.jpg >? tools/cents/forrest.cent/resources/skins/jakarta-site/images/void.gif >? tools/cents/forrest.cent/resources/skins/jakarta-site/xslt/html/book2menu.xsl >? tools/cents/forrest.cent/resources/skins/jakarta-site/xslt/html/document2html.xsl >? tools/cents/forrest.cent/resources/skins/jakarta-site/xslt/html/site2xhtml.xsl >? tools/cents/forrest.cent/resources/skins/scarab-site/css/compact.css >? tools/cents/forrest.cent/resources/skins/scarab-site/css/main.css >? tools/cents/forrest.cent/resources/skins/scarab-site/css/ns4_toxins.css >? tools/cents/forrest.cent/resources/skins/scarab-site/css/print.css >? tools/cents/forrest.cent/resources/skins/scarab-site/images/add.jpg >? tools/cents/forrest.cent/resources/skins/scarab-site/images/ant_logo_medium.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/built-with-cocoon.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/favicon.ico >? tools/cents/forrest.cent/resources/skins/scarab-site/images/grn_alert.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_alert.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_alertsml.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_confirmsml.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_downarrow.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_downarrow_off.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_downarrow_on.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_help.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_infosml.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_uparrow.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_uparrow_off.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/icon_uparrow_on.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/krysalis-compatible.jpg >? tools/cents/forrest.cent/resources/skins/scarab-site/images/note.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/nw_min.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/remove.jpg >? tools/cents/forrest.cent/resources/skins/scarab-site/images/se_min.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/seperator.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/seperator2.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/seperator3.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/strich.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/sw_min.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/up_pointer.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/images/update.jpg >? tools/cents/forrest.cent/resources/skins/scarab-site/images/void.gif >? tools/cents/forrest.cent/resources/skins/scarab-site/xslt/html/book2menu.xsl >? tools/cents/forrest.cent/resources/skins/scarab-site/xslt/html/document2html.xsl >? tools/cents/forrest.cent/resources/skins/scarab-site/xslt/html/site2xhtml.xsl >? tools/cents/junit.cent/legal >? tools/cents/junit.cent/lib >? tools/cents/junit.cent/tasks.properties >? tools/cents/junit.cent/xbuild.xml >Index: src/documentation/xdocs/faq.xml >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/documentation/xdocs/faq.xml,v >retrieving revision 1.18 >diff -u -r1.18 faq.xml >--- src/documentation/xdocs/faq.xml 20 Jul 2002 12:54:53 -0000 1.18 >+++ src/documentation/xdocs/faq.xml 20 Jul 2002 22:34:40 -0000 >@@ -158,4 +158,35 @@ > We will probably enhance HSSF in the future to make this process easier. > </answer> > </faq> >+ <faq> >+ <question> >+ I tried to set cell values and Excel sheet name on my native language, >+ but I failed to do it. :( >+ </question> >+ <answer> >+ By default HSSF uses cell values and sheet names as compressed unicode, >+ so to support localization you should use Unicode. >+ To do it you should set it manually: >+ <source> >+ >+ // >+ // for sheet name >+ // >+ HSSFWorkbook wb = new HSSFWorkbook(); >+ HSSFSheet s = wb.createSheet(); >+ wb.setSheetName( 0, "SomeUnicodeName", HSSFWorkbook.ENCODING_UTF_16 ); >+ >+ >+ // >+ // for cell value >+ // >+ HSSFRow r = s.createRow( 0 ); >+ HSSFCell c = r.createCell( (short)0 ); >+ c.setCellType( HSSFCell.CELL_TYPE_STRING ); >+ c.setEncoding( HSSFCell.ENCODING_UTF_16 ); >+ c.setCellValue( "\u0422\u0435\u0441\u0442\u043E\u0432\u0430\u044F" ); >+ >+ </source> >+ </answer> >+ </faq> > </faqs> >Index: src/documentation/xdocs/hssf/how-to.xml >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/documentation/xdocs/hssf/how-to.xml,v >retrieving revision 1.12 >diff -u -r1.12 how-to.xml >--- src/documentation/xdocs/hssf/how-to.xml 15 Jun 2002 06:04:26 -0000 1.12 >+++ src/documentation/xdocs/hssf/how-to.xml 20 Jul 2002 22:34:48 -0000 >@@ -7,6 +7,7 @@ > <authors> > <person email="acoliver2@users.sourceforge.net" name="Andrew C. Oliver" id="AO"/> > <person email="glens@apache.org" name="Glen Stampoultzis" id="GJS"/> >+ <person email="sergeikozello@mail.ru" name="Sergei Kozello" id="SK"/> > </authors> > </header> > <body> >@@ -42,7 +43,10 @@ > sequence to the workbook. Sheets do not in themselves have a sheet > name (the tab at the bottom); you set > the name associated with a sheet by calling >- HSSFWorkbook.setSheetName(sheetindex,"SheetName").</p> >+ HSSFWorkbook.setSheetName(sheetindex,"SheetName",encoding). >+ The name may be in 8bit format (HSSFWorkbook.ENCODING_COMPRESSED_UNICODE) >+ or Unicode (HSSFWorkbook.ENCODING_UTF_16). Default encoding is 8bit per char. >+ </p> > <p>Rows are created by calling createRow(rowNumber) from an existing > instance of HSSFSheet. Only rows that have cell values should be > added to the sheet. To set the row's height, you just call >@@ -98,18 +102,20 @@ > > //set font 1 to 12 point type > f.setFontHeightInPoints((short) 12); >-//make it red >-f.setColor((short) HSSFColor.RED.index); >+//make it blue >+f.setColor( (short)0xc ); > // make it bold > //arial is the default font >-f.setBoldweight(f.BOLDWEIGHT_BOLD); >+f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); > > //set font 2 to 10 point type > f2.setFontHeightInPoints((short) 10); >-//make it the color at palette index 0xf (white) >-f2.setColor((short) HSSFColor.WHITE.index); >+//make it red >+f2.setColor( (short)HSSFFont.COLOR_RED ); > //make it bold >-f2.setBoldweight(f2.BOLDWEIGHT_BOLD); >+f2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); >+ >+f2.setStrikeout( true ); > > //set cell stlye > cs.setFont(f); >@@ -120,16 +126,18 @@ > cs2.setBorderBottom(cs2.BORDER_THIN); > //fill w fg fill color > cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND); >-// set foreground fill to red >-cs2.setFillForegroundColor((short) HSSFColor.RED.index); > > // set the font > cs2.setFont(f2); > >-// set the sheet name to HSSF Test >-wb.setSheetName(0, "HSSF Test"); >-// create a sheet with 300 rows (0-299) >-for (rownum = (short) 0; rownum < 300; rownum++) >+// set the sheet name in Unicode >+wb.setSheetName(0, "\u0422\u0435\u0441\u0442\u043E\u0432\u0430\u044F " + >+ "\u0421\u0442\u0440\u0430\u043D\u0438\u0447\u043A\u0430", >+ HSSFWorkbook.ENCODING_UTF_16 ); >+// in case of compressed Unicode >+// wb.setSheetName(0, "HSSF Test", HSSFWorkbook.ENCODING_COMPRESSED_UNICODE ); >+// create a sheet with 30 rows (0-29) >+for (rownum = (short) 0; rownum < 30; rownum++) > { > // create a row > r = s.createRow(rownum); >@@ -141,8 +149,8 @@ > } > > //r.setRowNum(( short ) rownum); >- // create 50 cells (0-49) (the += 2 becomes apparent later >- for (short cellnum = (short) 0; cellnum < 50; cellnum += 2) >+ // create 10 cells (0-9) (the += 2 becomes apparent later >+ for (short cellnum = (short) 0; cellnum < 10; cellnum += 2) > { > // create a numeric cell > c = r.createCell(cellnum); >@@ -151,29 +159,31 @@ > + (((double) rownum / 1000) > + ((double) cellnum / 10000))); > >+ String cellValue; >+ >+ // create a string cell (see why += 2 in the >+ c = r.createCell((short) (cellnum + 1)); >+ > // on every other row > if ((rownum % 2) == 0) > { > // set this cell to the first cell style we defined > c.setCellStyle(cs); >+ // set the cell's string value to "Test" >+ c.setEncoding( HSSFCell.ENCODING_COMPRESSED_UNICODE ); >+ c.setCellValue( "Test" ); > } >- >- // create a string cell (see why += 2 in the >- c = r.createCell((short) (cellnum + 1)); >- >- // set the cell's string value to "TEST" >- c.setCellValue("TEST"); >- // make this column a bit wider >- s.setColumnWidth((short) (cellnum + 1), (short) ((50 * 8) / ((double) 1 / 20))); >- >- // on every other row >- if ((rownum % 2) == 0) >+ else > { >- // set this to the white on red cell style >- // we defined above > c.setCellStyle(cs2); >+ // set the cell's string value to "\u0422\u0435\u0441\u0442" >+ c.setEncoding( HSSFCell.ENCODING_UTF_16 ); >+ c.setCellValue( "\u0422\u0435\u0441\u0442" ); > } > >+ >+ // make this column a bit wider >+ s.setColumnWidth((short) (cellnum + 1), (short) ((50 * 8) / ((double) 1 / 20))); > } > } > >@@ -383,21 +393,21 @@ > its code is repeated above. To run it: > </p> > <ul> >- <li>download the poi-alpha build and untar it (tar xvzf >- tarball.tar.gz) >- </li> >- <li>set up your classpath as follows: >- <code>export HSSFDIR={wherever you put HSSF's jar files} >+ <li>download the poi-alpha build and untar it (tar xvzf >+ tarball.tar.gz) >+ </li> >+ <li>set up your classpath as follows: >+ <code>export HSSFDIR={wherever you put HSSF's jar files} > export LOG4JDIR={wherever you put LOG4J's jar files} > export CLASSPATH=$CLASSPATH:$HSSFDIR/hssf.jar:$HSSFDIR/poi-poifs.jar:$HSSFDIR/poi-util.jar:$LOG4JDIR/jog4j.jar</code> >- </li><li>type: >- <code>java org.apache.poi.hssf.dev.HSSF ~/myxls.xls write</code></li> >+ </li><li>type: >+ <code>java org.apache.poi.hssf.dev.HSSF ~/myxls.xls write</code></li> > </ul> > <p></p> > <p>This should generate a test sheet in your home directory called <code>"myxls.xls"</code>. </p> > <ul> >- <li>Type: >- <code>java org.apache.poi.hssf.dev.HSSF ~/input.xls output.xls</code> >+ <li>Type: >+ <code>java org.apache.poi.hssf.dev.HSSF ~/input.xls output.xls</code> > <br/> > <br/> > This is the read/write/modify test. It reads in the spreadsheet, modifies a cell, and writes it back out. >Index: src/java/org/apache/poi/hssf/model/Workbook.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/model/Workbook.java,v >retrieving revision 1.12 >diff -u -r1.12 Workbook.java >--- src/java/org/apache/poi/hssf/model/Workbook.java 20 Jul 2002 14:10:57 -0000 1.12 >+++ src/java/org/apache/poi/hssf/model/Workbook.java 20 Jul 2002 22:35:02 -0000 >@@ -60,6 +60,7 @@ > import java.util.ArrayList; > import java.util.List; > import java.util.Iterator; >+import java.util.Locale; > > > import org.apache.poi.util.POILogger; >@@ -85,6 +86,7 @@ > * > * @author Andrew C. Oliver (acoliver at apache dot org) > * @author Glen Stampoultzis (glens at apache.org) >+ * @author Sergei Kozello (sergeikozello at mail.ru) > * @see org.apache.poi.hssf.usermodel.HSSFWorkbook > * @version 1.0-pre > */ >@@ -410,6 +412,7 @@ > return ( BackupRecord ) records.get(backuppos); > } > >+ > /** > * sets the name for a given sheet. If the boundsheet record doesn't exist and > * its only one more than we have, go ahead and create it. If its > 1 more than >@@ -419,12 +422,18 @@ > * @param sheetname the name for the sheet > */ > >- public void setSheetName(int sheetnum, String sheetname) { >+ // for compartibility >+ public void setSheetName(int sheetnum, String sheetname ) { >+ setSheetName( sheetnum, sheetname, (byte)0 ); >+ } >+ >+ public void setSheetName(int sheetnum, String sheetname, short encoding ) { > checkSheets(sheetnum); >- (( BoundSheetRecord ) boundsheets.get(sheetnum)) >- .setSheetname(sheetname); >- (( BoundSheetRecord ) boundsheets.get(sheetnum)) >- .setSheetnameLength(( byte ) sheetname.length()); >+ >+ BoundSheetRecord sheet = (BoundSheetRecord)boundsheets.get( sheetnum ); >+ sheet.setSheetname(sheetname); >+ sheet.setSheetnameLength( (byte)sheetname.length() ); >+ sheet.setCompressedUnicodeFlag( (byte)encoding ); > } > > /** >@@ -1586,7 +1595,8 @@ > } > > /** >- * Creates the Country record with the default and current country set to 1 >+ * Creates the Country record with the default country set to 1 >+ * and current country set to 7 in case of russian locale ("ru_RU") and 1 otherwise > * @return record containing a CountryRecord > * @see org.apache.poi.hssf.record.CountryRecord > * @see org.apache.poi.hssf.record.Record >@@ -1596,7 +1606,15 @@ > CountryRecord retval = new CountryRecord(); > > retval.setDefaultCountry(( short ) 1); >- retval.setCurrentCountry(( short ) 1); >+ >+ // from Russia with love ;) >+ if ( Locale.getDefault().toString().equals( "ru_RU" ) ) { >+ retval.setCurrentCountry(( short ) 7); >+ } >+ else { >+ retval.setCurrentCountry(( short ) 1); >+ } >+ > return retval; > } > >Index: src/java/org/apache/poi/hssf/record/BoundSheetRecord.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java,v >retrieving revision 1.4 >diff -u -r1.4 BoundSheetRecord.java >--- src/java/org/apache/poi/hssf/record/BoundSheetRecord.java 1 Mar 2002 13:27:10 -0000 1.4 >+++ src/java/org/apache/poi/hssf/record/BoundSheetRecord.java 20 Jul 2002 22:35:05 -0000 >@@ -55,8 +55,13 @@ > > package org.apache.poi.hssf.record; > >+import java.io.*; >+import java.io.UnsupportedEncodingException; >+ >+import org.apache.poi.util.BinaryTree; > import org.apache.poi.util.LittleEndian; > import org.apache.poi.util.StringUtil; >+import sun.awt.image.ByteInterleavedRaster; > > /** > * Title: Bound Sheet Record (aka BundleSheet) <P> >@@ -65,6 +70,7 @@ > * file. <P> > * REFERENCE: PG 291 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P> > * @author Andrew C. Oliver (acoliver at apache dot org) >+ * @author Sergei Kozello (sergeikozello at mail.ru) > * @version 2.0-pre > */ > >@@ -116,18 +122,33 @@ > throw new RecordFormatException("NOT A Bound Sheet RECORD"); > } > } >+ >+ /** >+ * UTF8: >+ * sid + len + bof + flags + len(str) + unicode + str >+ * 2 + 2 + 4 + 2 + 1 + 1 + len(str) >+ * >+ * UNICODE: >+ * sid + len + bof + flags + len(str) + unicode + str >+ * 2 + 2 + 4 + 2 + 1 + 1 + 2 * len(str) >+ * >+ */ > > protected void fillFields(byte [] data, short size, int offset) > { >- field_1_position_of_BOF = LittleEndian.getInt(data, >- 0 + offset); >- field_2_option_flags = LittleEndian.getShort(data, >- 4 + offset); >- field_3_sheetname_length = data[ 6 + offset ]; >- field_4_compressed_unicode_flag = data[ 7 + offset ]; >- field_5_sheetname = new String(data, 8 + offset, >- LittleEndian.ubyteToInt( field_3_sheetname_length)); >- } >+ field_1_position_of_BOF = LittleEndian.getInt(data, 0 + offset); // bof >+ field_2_option_flags = LittleEndian.getShort(data, 4 + offset); // flags >+ field_3_sheetname_length = data[ 6 + offset ]; // len(str) >+ field_4_compressed_unicode_flag = data[ 7 + offset ]; // unicode >+ >+ int nameLength = LittleEndian.ubyteToInt( field_3_sheetname_length ); >+ if ( ( field_4_compressed_unicode_flag & 0x01 ) == 1 ) { >+ field_5_sheetname = StringUtil.getFromUnicodeHigh( data, 8 + offset, nameLength ); >+ } >+ else { >+ field_5_sheetname = new String( data, 8 + offset, nameLength ); >+ } >+ } > > /** > * set the offset in bytes of the Beginning of File Marker within the HSSF Stream part of the POIFS file >@@ -169,7 +190,7 @@ > * @param flag (0/1) 0- compressed, 1 - uncompressed (16-bit) > */ > >- public void setCompressedUnicodeFlag(byte flag) >+ public void setCompressedUnicodeFlag( byte flag ) > { > field_4_compressed_unicode_flag = flag; > } >@@ -178,8 +199,8 @@ > * Set the sheetname for this sheet. (this appears in the tabs at the bottom) > * @param sheetname the name of the sheet > */ >- >- public void setSheetname(String sheetname) >+ >+ public void setSheetname( String sheetname ) > { > field_5_sheetname = sheetname; > } >@@ -215,7 +236,21 @@ > > public byte getSheetnameLength() > { >- return field_3_sheetname_length; >+ return field_3_sheetname_length; >+ } >+ >+ /** >+ * get the length of the raw sheetname in characters >+ * the length depends on the unicode flag >+ * >+ * @return number of characters in the raw sheet name >+ */ >+ >+ public byte getRawSheetnameLength() >+ { >+ return (byte)( ( ( field_4_compressed_unicode_flag & 0x01 ) == 1 ) >+ ? 2 * field_3_sheetname_length >+ : field_3_sheetname_length ); > } > > /** >@@ -262,22 +297,47 @@ > public int serialize(int offset, byte [] data) > { > LittleEndian.putShort(data, 0 + offset, sid); >- LittleEndian.putShort(data, 2 + offset, >- ( short ) (0x08 + getSheetnameLength())); >+ LittleEndian.putShort( data, 2 + offset, (short)( 8 + getRawSheetnameLength() ) ); > LittleEndian.putInt(data, 4 + offset, getPositionOfBof()); > LittleEndian.putShort(data, 8 + offset, getOptionFlags()); >- data[ 10 + offset ] = getSheetnameLength(); >+ data[ 10 + offset ] = (byte)( getSheetnameLength() ); > data[ 11 + offset ] = getCompressedUnicodeFlag(); >+ >+ if ( ( field_4_compressed_unicode_flag & 0x01 ) == 1 ) >+ StringUtil.putUncompressedUnicode( getSheetname(), data, 12 + offset ); >+ else >+ StringUtil.putCompressedUnicode( getSheetname(), data, 12 + offset ); >+ > >- // we assume compressed unicode (bein the dern americans we are ;-p) >- StringUtil.putCompressedUnicode(getSheetname(), data, 12 + offset); > return getRecordSize(); >+ >+ /* >+ byte[] fake = new byte[] { (byte)0x85, 0x00, // sid >+ 0x1a, 0x00, // length >+ 0x3C, 0x09, 0x00, 0x00, // bof >+ 0x00, 0x00, // flags >+ 0x09, // len( str ) >+ 0x01, // unicode >+ // <str> >+ 0x21, 0x04, 0x42, 0x04, 0x40, 0x04, 0x30, 0x04, 0x3D, >+ 0x04, 0x38, 0x04, 0x47, 0x04, 0x3A, 0x04, 0x30, 0x04 >+ // </str> >+ }; >+ >+ sid + len + bof + flags + len(str) + unicode + str >+ 2 + 2 + 4 + 2 + 1 + 1 + len(str) >+ >+ System.arraycopy( fake, 0, data, offset, fake.length ); >+ >+ return fake.length; >+ */ > } > > public int getRecordSize() > { >- return 12 + getSheetnameLength(); >- } >+ // return 30; >+ return 12 + getRawSheetnameLength(); >+ } > > public short getSid() > { >Index: src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java,v >retrieving revision 1.7 >diff -u -r1.7 HSSFWorkbook.java >--- src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java 23 Apr 2002 22:24:41 -0000 1.7 >+++ src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java 20 Jul 2002 22:35:11 -0000 >@@ -70,6 +70,7 @@ > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; >+import java.io.UnsupportedEncodingException; > import java.util.ArrayList; > import java.util.List; > >@@ -82,6 +83,7 @@ > * @see org.apache.poi.hssf.usermodel.HSSFSheet > * @author Andrew C. Oliver (acoliver at apache dot org) > * @author Glen Stampoultzis (glens at apache.org) >+ * @author Sergei Kozello (sergeikozello at mail.ru) > * @version 2.0-pre > */ > >@@ -200,7 +202,11 @@ > > // none currently > } >- >+ >+ >+ public final static byte ENCODING_COMPRESSED_UNICODE = 0; >+ public final static byte ENCODING_UTF_16 = 1; >+ > /** > * set the sheet name. > * @param sheet number (0 based) >@@ -209,13 +215,29 @@ > > public void setSheetName(int sheet, String name) > { >+ workbook.setSheetName( sheet, name, ENCODING_COMPRESSED_UNICODE ); >+ } >+ >+ public void setSheetName( int sheet, String name, short encoding ) >+ { > if (sheet > (sheets.size() - 1)) > { > throw new RuntimeException("Sheet out of bounds"); > } >- workbook.setSheetName(sheet, name); >+ >+ switch ( encoding ) { >+ case ENCODING_COMPRESSED_UNICODE: >+ case ENCODING_UTF_16: >+ break; >+ >+ default: >+ // TODO java.io.UnsupportedEncodingException >+ throw new RuntimeException( "Unsupported encoding" ); >+ } >+ >+ workbook.setSheetName( sheet, name, encoding ); > } >- >+ > /** > * get the sheet name > * @param sheet Number >Index: src/java/org/apache/poi/util/StringUtil.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/util/StringUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 StringUtil.java >--- src/java/org/apache/poi/util/StringUtil.java 19 May 2002 17:54:07 -0000 1.2 >+++ src/java/org/apache/poi/util/StringUtil.java 20 Jul 2002 22:35:14 -0000 >@@ -62,8 +62,14 @@ > > /** > * Title: String Utility Description: Collection of string handling utilities >+ * >+ * Now it is quite confusing: the method pairs, in which >+ * one of them write data and other read written data are: >+ * putUncompressedUnicodeHigh and getFromUnicode >+ * putUncompressedUnicode and getFromUnicodeHigh > * > *@author Andrew C. Oliver >+ *@author Sergei Kozello (sergeikozello at mail.ru) > *@created May 10, 2002 > *@version 1.0 > */ >@@ -79,6 +85,8 @@ > * given a byte array of 16-bit unicode characters, compress to 8-bit and > * return a string > * >+ * { 0x16, 0x00 } -> 0x16 >+ * > *@param string the byte array to be converted > *@param offset the initial offset into the > * byte array. it is assumed that string[ offset ] and string[ offset + >@@ -103,22 +111,37 @@ > if ((len < 0) || (((string.length - offset) / 2) < len)) { > throw new IllegalArgumentException("Illegal length"); > } >- byte[] bstring = new byte[len]; >- int index = offset; >- // start with high bits. >- >- for (int k = 0; k < len; k++) { >- bstring[k] = string[index]; >- index += 2; >+ >+ char[] chars = new char[ len ]; >+ for ( int i = 0; i < chars.length; i++ ) { >+ chars[i] = (char)( string[ offset + ( 2*i ) ] + >+ ( string[ offset + ( 2*i+1 ) ] << 8 ) ); > } >- return new String(bstring); >+ >+ return new String( chars ); > } > > >+ /** >+ * given a byte array of 16-bit unicode characters, compress to 8-bit and >+ * return a string >+ * >+ * { 0x16, 0x00 } -> 0x16 >+ * >+ *@param string the byte array to be converted >+ *@return the converted string >+ */ >+ >+ public static String getFromUnicodeHigh( final byte[] string ) { >+ return getFromUnicodeHigh( string, 0, string.length / 2 ); >+ } >+ > > /** > * given a byte array of 16-bit unicode characters, compress to 8-bit and > * return a string >+ * >+ * { 0x00, 0x16 } -> 0x16 > * > *@param string the byte array to be converted > *@param offset the initial offset into the >@@ -144,21 +167,23 @@ > if ((len < 0) || (((string.length - offset) / 2) < len)) { > throw new IllegalArgumentException("Illegal length"); > } >- byte[] bstring = new byte[len]; >- int index = offset + 1; >- // start with low bits. >- >- for (int k = 0; k < len; k++) { >- bstring[k] = string[index]; >- index += 2; >+ >+ >+ char[] chars = new char[ len ]; >+ for ( int i = 0; i < chars.length; i++ ) { >+ chars[i] = (char)( ( string[ offset + ( 2*i ) ] << 8 ) + >+ string[ offset + ( 2*i+1 ) ] ); > } >- return new String(bstring); >+ >+ return new String( chars ); > } > > > /** > * given a byte array of 16-bit unicode characters, compress to 8-bit and > * return a string >+ * >+ * { 0x00, 0x16 } -> 0x16 > * > *@param string the byte array to be converted > *@return the converted string >Index: src/testcases/org/apache/poi/util/TestStringUtil.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/testcases/org/apache/poi/util/TestStringUtil.java,v >retrieving revision 1.2 >diff -u -r1.2 TestStringUtil.java >--- src/testcases/org/apache/poi/util/TestStringUtil.java 11 Feb 2002 04:23:11 -0000 1.2 >+++ src/testcases/org/apache/poi/util/TestStringUtil.java 20 Jul 2002 22:35:22 -0000 >@@ -64,6 +64,7 @@ > * > * @author Marc Johnson (mjohnson at apache dot org > * @author Glen Stampoultzis (glens at apache.org) >+ * @author Sergei Kozello (sergeikozello at mail.ru) > */ > > public class TestStringUtil >@@ -97,6 +98,48 @@ > } > assertEquals("abcdefghijklmnop", > StringUtil.getFromUnicode(test_data)); >+ } >+ >+ /** >+ * test simple form of getFromUnicode with symbols with code below and more 127 >+ */ >+ >+ public void testGetFromUnicodeSymbolsWithCodesMoreThan127() >+ { >+ byte[] test_data = new byte[] { 0x04, 0x22, >+ 0x04, 0x35, >+ 0x04, 0x41, >+ 0x04, 0x42, >+ 0x00, 0x20, >+ 0x00, 0x74, >+ 0x00, 0x65, >+ 0x00, 0x73, >+ 0x00, 0x74, >+ }; >+ >+ assertEquals("\u0422\u0435\u0441\u0442 test", >+ StringUtil.getFromUnicode(test_data)); >+ } >+ >+ /** >+ * test getFromUnicodeHigh for symbols with code below and more 127 >+ */ >+ >+ public void testGetFromUnicodeHighSymbolsWithCodesMoreThan127() >+ { >+ byte[] test_data = new byte[] { 0x22, 0x04, >+ 0x35, 0x04, >+ 0x41, 0x04, >+ 0x42, 0x04, >+ 0x20, 0x00, >+ 0x74, 0x00, >+ 0x65, 0x00, >+ 0x73, 0x00, >+ 0x74, 0x00, >+ }; >+ >+ assertEquals("\u0422\u0435\u0441\u0442 test", >+ StringUtil.getFromUnicodeHigh( test_data ) ); > } > > /**
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 10548
:
2331
|
2332
|
2333
| 2422 |
2423
|
2424
|
2430