ASF Bugzilla – Attachment 14497 Details for
Bug 34007
[PATCH] Unable to set cell format with non latin1 characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Autodetect if we need unicoded format
poi.unicode.patch (text/plain), 1.40 KB, created by
Alexander Litvinov
on 2005-03-16 12:59:47 UTC
(
hide
)
Description:
Autodetect if we need unicoded format
Filename:
MIME Type:
Creator:
Alexander Litvinov
Created:
2005-03-16 12:59:47 UTC
Size:
1.40 KB
patch
obsolete
>diff -Nur poi.original/src/java/org/apache/poi/hssf/model/Workbook.java poi.patched/src/java/org/apache/poi/hssf/model/Workbook.java >--- poi.original/src/java/org/apache/poi/hssf/model/Workbook.java 2004-07-28 20:06:32.000000000 +0700 >+++ poi.patched/src/java/org/apache/poi/hssf/model/Workbook.java 2005-03-16 17:42:06.264563855 +0600 >@@ -29,6 +29,7 @@ > import java.util.Iterator; > import java.util.List; > import java.util.Locale; >+import java.io.UnsupportedEncodingException; > > /** > * Low level model implementation of a Workbook. Provides creational methods >@@ -1963,6 +1964,7 @@ > maxformatid = maxformatid >= (short) 0xa4 ? (short) ( maxformatid + 1 ) : (short) 0xa4; //Starting value from M$ empiracle study. > rec.setIndexCode( maxformatid ); > rec.setFormatStringLength( (byte) format.length() ); >+ rec.setUnicodeFlag(isUnicodeFormat(format)); > rec.setFormatString( format ); > > int pos = 0; >@@ -1974,6 +1976,17 @@ > return maxformatid; > } > >+ /** >+ * @param format >+ * @return true if format is Unicode. >+ */ >+ private boolean isUnicodeFormat(final String format) { >+ try { >+ return !format.equals(new String(format.getBytes("ISO-8859-1"), "ISO-8859-1")); >+ } catch (UnsupportedEncodingException e) { >+ return true; >+ } >+ } > > /** > * Returns the first occurance of a record matching a particular sid.
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 34007
:
14486
| 14497