aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRainer Klute <klute@apache.org>2005-04-23 14:17:07 +0000
committerRainer Klute <klute@apache.org>2005-04-23 14:17:07 +0000
commit786087299349f54257ede837bd37b2c144a85245 (patch)
treee1437871712611f57e35e46796e5d9e84e4daa0f /src
parent6ff805edf37a0d579602c21db41be48090c4046d (diff)
downloadpoi-786087299349f54257ede837bd37b2c144a85245.tar.gz
poi-786087299349f54257ede837bd37b2c144a85245.zip
- Added a couple of Macintosh codepage numbers to Java encoding names.
Thanks to Ralf Terdic <ralf.t@gmx.net> for providing them! However, please note that neither Ralf nor I were able to test all those mappings. So please post a bug if you encounter any problems! git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353650 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/hpsf/Constants.java56
-rw-r--r--src/java/org/apache/poi/hpsf/VariantSupport.java32
2 files changed, 84 insertions, 4 deletions
diff --git a/src/java/org/apache/poi/hpsf/Constants.java b/src/java/org/apache/poi/hpsf/Constants.java
index e5656ae3d8..b5d4d3e8c4 100644
--- a/src/java/org/apache/poi/hpsf/Constants.java
+++ b/src/java/org/apache/poi/hpsf/Constants.java
@@ -11,15 +11,65 @@ package org.apache.poi.hpsf;
public class Constants
{
- /** <p>Codepage for Macintosh Roman (MacRoman)</p> */
- public static final int CP_MACROMAN = 10000;
-
/** <p>Codepage for SJIS</p> */
public static final int CP_SJIS = 932;
/** <p>Codepage for UTF-16</p> */
public static final int CP_UTF16 = 1200;
+ /** <p>Codepage for Macintosh Roman (Java: MacRoman)</p> */
+ public static final int CP_MAC_ROMAN = 10000;
+
+ /** <p>Codepage for Macintosh Japan (Java: unknown - use SJIS, cp942 or
+ * cp943)</p> */
+ public static final int CP_MAC_JAPAN = 10001;
+
+ /** <p>Codepage for Macintosh Chinese Traditional (Java: unknown - use Big5,
+ * MS950, or cp937)</p> */
+ public static final int CP_MAC_CHINESE_TRADITIONAL = 10002;
+
+ /** <p>Codepage for Macintosh Korean (Java: unknown - use EUC_KR or
+ * cp949)</p> */
+ public static final int CP_MAC_KOREAN = 10003;
+
+ /** <p>Codepage for Macintosh Arabic (Java: MacArabic)</p> */
+ public static final int CP_MAC_ARABIC = 10004;
+
+ /** <p>Codepage for Macintosh Hebrew (Java: MacHebrew)</p> */
+ public static final int CP_MAC_HEBREW = 10005;
+
+ /** <p>Codepage for Macintosh Greek (Java: MacGreek)</p> */
+ public static final int CP_MAC_GREEK = 10006;
+
+ /** <p>Codepage for Macintosh Cyrillic (Java: MacCyrillic)</p> */
+ public static final int CP_MAC_CYRILLIC = 10007;
+
+ /** <p>Codepage for Macintosh Chinese Simplified (Java: unknown - use
+ * EUC_CN, ISO2022_CN_GB, MS936 or cp935)</p> */
+ public static final int CP_MAC_CHINESE_SIMPLE = 10008;
+
+ /** <p>Codepage for Macintosh Romanian (Java: MacRomania)</p> */
+ public static final int CP_MAC_ROMANIA = 10010;
+
+ /** <p>Codepage for Macintosh Ukrainian (Java: MacUkraine)</p> */
+ public static final int CP_MAC_UKRAINE = 10017;
+
+ /** <p>Codepage for Macintosh Thai (Java: MacThai)</p> */
+ public static final int CP_MAC_THAI = 10021;
+
+ /** <p>Codepage for Macintosh Central Europe (Latin-2)
+ * (Java: MacCentralEurope)</p> */
+ public static final int CP_MAC_CENTRAL_EUROPE = 10029;
+
+ /** <p>Codepage for Macintosh Iceland (Java: MacIceland)</p> */
+ public static final int CP_MAC_ICELAND = 10079;
+
+ /** <p>Codepage for Macintosh Turkish (Java: MacTurkish)</p> */
+ public static final int CP_MAC_TURKISH = 10081;
+
+ /** <p>Codepage for Macintosh Croatian (Java: MacCroatian)</p> */
+ public static final int CP_MAC_CROATIAN = 10082;
+
/** <p>Codepage for UTF-8</p> */
public static final int CP_UTF8 = 65001;
diff --git a/src/java/org/apache/poi/hpsf/VariantSupport.java b/src/java/org/apache/poi/hpsf/VariantSupport.java
index b9ab14ffca..ebb2c3722e 100644
--- a/src/java/org/apache/poi/hpsf/VariantSupport.java
+++ b/src/java/org/apache/poi/hpsf/VariantSupport.java
@@ -294,8 +294,38 @@ public class VariantSupport extends Variant
("Codepage number may not be " + codepage);
switch (codepage)
{
- case Constants.CP_MACROMAN:
+ case Constants.CP_MAC_ROMAN:
return "MacRoman";
+ case Constants.CP_MAC_JAPAN:
+ return "SJIS";
+ case Constants.CP_MAC_CHINESE_TRADITIONAL:
+ return "Big5";
+ case Constants.CP_MAC_KOREAN:
+ return "EUC-KR";
+ case Constants.CP_MAC_ARABIC:
+ return "MacArabic";
+ case Constants.CP_MAC_HEBREW:
+ return "MacHebrew";
+ case Constants.CP_MAC_GREEK:
+ return "MacGreek";
+ case Constants.CP_MAC_CYRILLIC:
+ return "MacCyrillic";
+ case Constants.CP_MAC_CHINESE_SIMPLE:
+ return "EUC_CN";
+ case Constants.CP_MAC_ROMANIA:
+ return "MacRomania";
+ case Constants.CP_MAC_UKRAINE:
+ return "MacUkraine";
+ case Constants.CP_MAC_THAI:
+ return "MacThai";
+ case Constants.CP_MAC_CENTRAL_EUROPE:
+ return "MacCentralEurope";
+ case Constants.CP_MAC_ICELAND:
+ return "MacIceland";
+ case Constants.CP_MAC_TURKISH:
+ return "MacTurkish";
+ case Constants.CP_MAC_CROATIAN:
+ return "MacCroatian";
case Constants.CP_SJIS:
return "SJIS";
case Constants.CP_UTF16: