Bug 20899

Summary: HSSFCell setCellValue problem
Product: POI Reporter: tommy <joblee>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: 1.5.1   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description tommy 2003-06-19 05:12:34 UTC
when the string u is not a enlgish or number sentence,the file data have 
problem.

FileOutputStream  out = new FileOutputStream ("C:/workbook.xls");		
HSSFWorkbook wb = new HSSFWorkbook();
HSSFRow r = null;
HSSFCell c = null;
r = s.createRow((short)0);
c = r.createCell((short)0);	
String u="‘ªŽŽŒÜ˜ZŽµ";
c.setCellValue(u);
c.setCellType( HSSFCell.CELL_TYPE_STRING );
c.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE);
wb.write(out);
Comment 1 Andy Oliver 2003-07-24 16:56:44 UTC
yes, for this you should set the encoding to the UTF_16 (which we need to
correct to be more lear in 3.0)