Bug 34007

Summary: [PATCH] Unable to set cell format with non latin1 characters
Product: POI Reporter: Alexander Litvinov <lan>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: major CC: jjoji, pete
Priority: P2    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: setUnicodeFlag on FromatRecord
Autodetect if we need unicoded format

Description Alexander Litvinov 2005-03-14 13:52:26 UTC
I am not able to setup cell format that contains russion characters because
method 
public short createFormat( String format )
of 
java/org/apache/poi/hssf/model/Workbook.java
create FormatRecord object without setUnicodeFlag and where are
no methods I have found to set this flag my self. So I hacked it to be
unicode always. I know this is not good - better solution is to detect
whatever string can be represented in latin1 charset or not. By the
way why don't do this everywhere in the project ?

Patch for seting unicode flag will be attached.
Comment 1 Alexander Litvinov 2005-03-14 13:54:57 UTC
Created attachment 14486 [details]
setUnicodeFlag on FromatRecord

I forgot to tell the version: 
this patch made from poi-src-2.5.1-final-20040804
Comment 2 Andy Oliver 2005-03-14 15:22:12 UTC
Please change the patch to instead offer an API for toggling it on/off via the
workbook.  It is inapporpriate to force unicode for everyone.
Comment 3 Alexander Litvinov 2005-03-16 12:59:47 UTC
Created attachment 14497 [details]
Autodetect if we need unicoded format

Here is the new patch. 
It detects if format string is ISO-8859-1, if it is not set unicode flag of
FromatRecord to true.
Comment 4 Avik Sengupta 2005-04-22 13:37:17 UTC
Looks good. Anyone have any issues with this? I'll commit it otherwise.
Comment 5 Avik Sengupta 2005-04-22 17:13:33 UTC
*** Bug 20146 has been marked as a duplicate of this bug. ***
Comment 6 Avik Sengupta 2005-04-28 16:09:04 UTC
Applied, thanks. 
Comment 7 Avik Sengupta 2005-04-28 16:42:43 UTC
*** Bug 27921 has been marked as a duplicate of this bug. ***