Bug 34007 - [PATCH] Unable to set cell format with non latin1 characters
Summary: [PATCH] Unable to set cell format with non latin1 characters
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.5-FINAL
Hardware: PC Linux
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
: 20146 27921 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-14 13:52 UTC by Alexander Litvinov
Modified: 2005-04-28 08:42 UTC (History)
2 users (show)



Attachments
setUnicodeFlag on FromatRecord (574 bytes, patch)
2005-03-14 13:54 UTC, Alexander Litvinov
Details | Diff
Autodetect if we need unicoded format (1.40 KB, patch)
2005-03-16 12:59 UTC, Alexander Litvinov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***