import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
throw new RuntimeException("resource '" + METADATA_FILE_NAME + "' not found");
}
- BufferedReader br = new BufferedReader(new InputStreamReader(is));
+ BufferedReader br = null;
+ try {
+ br = new BufferedReader(new InputStreamReader(is,"UTF-8"));
+ } catch(UnsupportedEncodingException e) { /* never happens */ }
FunctionDataBuilder fdb = new FunctionDataBuilder(400);
try {
case 'R': return Ptg.CLASS_REF;
case 'A': return Ptg.CLASS_ARRAY;
}
- throw new IllegalArgumentException("Unexpected operand type code '" + code + "'");
+ throw new IllegalArgumentException("Unexpected operand type code '" + code + "' (" + (int)code.charAt(0) + ")");
}
/**
7 MAX 1 30 V R \r
8 ROW 0 1 V R \r
9 COLUMN 0 1 V R \r
-10 NA 0 0 V \96 \r
+10 NA 0 0 V – \r
11 NPV 2 30 V V R \r
12 STDEV 1 30 V R \r
13 DOLLAR 1 2 V V V \r
16 COS 1 1 V V \r
17 TAN 1 1 V V \r
18 ARCTAN 1 1 V V \r
-19 PI 0 0 V \96 \r
+19 PI 0 0 V – \r
20 SQRT 1 1 V V \r
21 EXP 1 1 V V \r
22 LN 1 1 V V \r
31 MID 3 3 V V V V \r
32 LEN 1 1 V V \r
33 VALUE 1 1 V V \r
-34 TRUE 0 0 V \96 \r
-35 FALSE 0 0 V \96 \r
+34 TRUE 0 0 V – \r
+35 FALSE 0 0 V – \r
36 AND 1 30 V R \r
37 OR 1 30 V R \r
38 NOT 1 1 V V \r
60 RATE 3 6 V V V V V V V \r
61 MIRR 3 3 V R V V \r
62 IRR 1 2 V R V \r
-63 RAND 0 0 V \96 x \r
+63 RAND 0 0 V – x \r
64 MATCH 2 3 V V R R \r
65 DATE 3 3 V V V V \r
66 TIME 3 3 V V V V \r
71 HOUR 1 1 V V \r
72 MINUTE 1 1 V V \r
73 SECOND 1 1 V V \r
-74 NOW 0 0 V \96 x \r
+74 NOW 0 0 V – x \r
75 AREAS 1 1 V R \r
76 ROWS 1 1 V R \r
77 COLUMNS 1 1 V R \r
215 JIS 1 1 V V x\r
219 ADDRESS 2 5 V V V V V V \r
220 DAYS360 2 2 V V V x\r
-221 TODAY 0 0 V \96 x \r
+221 TODAY 0 0 V – x \r
222 VDB 5 7 V V V V V V V V \r
-227 MEDIAN 1 30 V R \85 \r
-228 SUMPRODUCT 1 30 V A \85 \r
+227 MEDIAN 1 30 V R … \r
+228 SUMPRODUCT 1 30 V A … \r
229 SINH 1 1 V V \r
230 COSH 1 1 V V \r
231 TANH 1 1 V V \r
247 DB 4 5 V V V V V V \r
252 FREQUENCY 2 2 A R R \r
261 ERROR.TYPE 1 1 V V \r
-269 AVEDEV 1 30 V R \85 \r
+269 AVEDEV 1 30 V R … \r
270 BETADIST 3 5 V V V V V V \r
271 GAMMALN 1 1 V V \r
272 BETAINV 3 5 V V V V V V \r
315 SLOPE 2 2 V A A \r
316 TTEST 4 4 V A A V V \r
317 PROB 3 4 V A A V V \r
-318 DEVSQ 1 30 V R \85 \r
-319 GEOMEAN 1 30 V R \85 \r
-320 HARMEAN 1 30 V R \85 \r
-321 SUMSQ 0 30 V R \85 \r
-322 KURT 1 30 V R \85 \r
-323 SKEW 1 30 V R \85 \r
+318 DEVSQ 1 30 V R … \r
+319 GEOMEAN 1 30 V R … \r
+320 HARMEAN 1 30 V R … \r
+321 SUMSQ 0 30 V R … \r
+322 KURT 1 30 V R … \r
+323 SKEW 1 30 V R … \r
324 ZTEST 2 3 V R V V \r
325 LARGE 2 2 V R V \r
326 SMALL 2 2 V R V \r
358 GETPIVOTDATA 2 30 \r
359 HYPERLINK 1 2 V V V \r
360 PHONETIC 1 1 V R \r
-361 AVERAGEA 1 30 V R \85 \r
-362 MAXA 1 30 V R \85 \r
-363 MINA 1 30 V R \85 \r
-364 STDEVPA 1 30 V R \85 \r
-365 VARPA 1 30 V R \85 \r
-366 STDEVA 1 30 V R \85 \r
-367 VARA 1 30 V R \85 \r
+361 AVERAGEA 1 30 V R … \r
+362 MAXA 1 30 V R … \r
+363 MINA 1 30 V R … \r
+364 STDEVPA 1 30 V R … \r
+365 VARPA 1 30 V R … \r
+366 STDEVA 1 30 V R … \r
+367 VARA 1 30 V R … \r
7 MAX 1 30 V R \r
8 ROW 0 1 V R \r
9 COLUMN 0 1 V R \r
-10 NA 0 0 V \96 \r
+10 NA 0 0 V – \r
11 NPV 2 30 V V R \r
12 STDEV 1 30 V R \r
13 DOLLAR 1 2 V V V \r
16 COS 1 1 V V \r
17 TAN 1 1 V V \r
18 ATAN 1 1 V V \r
-19 PI 0 0 V \96 \r
+19 PI 0 0 V – \r
20 SQRT 1 1 V V \r
21 EXP 1 1 V V \r
22 LN 1 1 V V \r
31 MID 3 3 V V V V \r
32 LEN 1 1 V V \r
33 VALUE 1 1 V V \r
-34 TRUE 0 0 V \96 \r
-35 FALSE 0 0 V \96 \r
+34 TRUE 0 0 V – \r
+35 FALSE 0 0 V – \r
36 AND 1 30 V R \r
37 OR 1 30 V R \r
38 NOT 1 1 V V \r
60 RATE 3 6 V V V V V V V \r
61 MIRR 3 3 V R V V \r
62 IRR 1 2 V R V \r
-63 RAND 0 0 V \96 x \r
+63 RAND 0 0 V – x \r
64 MATCH 2 3 V V R R \r
65 DATE 3 3 V V V V \r
66 TIME 3 3 V V V V \r
71 HOUR 1 1 V V \r
72 MINUTE 1 1 V V \r
73 SECOND 1 1 V V \r
-74 NOW 0 0 V \96 x \r
+74 NOW 0 0 V – x \r
75 AREAS 1 1 V R \r
76 ROWS 1 1 V R \r
77 COLUMNS 1 1 V R \r
215 JIS 1 1 V V x\r
219 ADDRESS 2 5 V V V V V V \r
220 DAYS360 2 2 V V V x\r
-221 TODAY 0 0 V \96 x \r
+221 TODAY 0 0 V – x \r
222 VDB 5 7 V V V V V V V V \r
-227 MEDIAN 1 30 V R \85 \r
-228 SUMPRODUCT 1 30 V A \85 \r
+227 MEDIAN 1 30 V R … \r
+228 SUMPRODUCT 1 30 V A … \r
229 SINH 1 1 V V \r
230 COSH 1 1 V V \r
231 TANH 1 1 V V \r
247 DB 4 5 V V V V V V \r
252 FREQUENCY 2 2 A R R \r
261 ERROR.TYPE 1 1 V V \r
-269 AVEDEV 1 30 V R \85 \r
+269 AVEDEV 1 30 V R … \r
270 BETADIST 3 5 V V V V V V \r
271 GAMMALN 1 1 V V \r
272 BETAINV 3 5 V V V V V V \r
315 SLOPE 2 2 V A A \r
316 TTEST 4 4 V A A V V \r
317 PROB 3 4 V A A V V \r
-318 DEVSQ 1 30 V R \85 \r
-319 GEOMEAN 1 30 V R \85 \r
-320 HARMEAN 1 30 V R \85 \r
-321 SUMSQ 0 30 V R \85 \r
-322 KURT 1 30 V R \85 \r
-323 SKEW 1 30 V R \85 \r
+318 DEVSQ 1 30 V R … \r
+319 GEOMEAN 1 30 V R … \r
+320 HARMEAN 1 30 V R … \r
+321 SUMSQ 0 30 V R … \r
+322 KURT 1 30 V R … \r
+323 SKEW 1 30 V R … \r
324 ZTEST 2 3 V R V V \r
325 LARGE 2 2 V R V \r
326 SMALL 2 2 V R V \r
358 GETPIVOTDATA 2 30 \r
359 HYPERLINK 1 2 V V V \r
360 PHONETIC 1 1 V R \r
-361 AVERAGEA 1 30 V R \85 \r
-362 MAXA 1 30 V R \85 \r
-363 MINA 1 30 V R \85 \r
-364 STDEVPA 1 30 V R \85 \r
-365 VARPA 1 30 V R \85 \r
-366 STDEVA 1 30 V R \85 \r
-367 VARA 1 30 V R \85 \r
+361 AVERAGEA 1 30 V R … \r
+362 MAXA 1 30 V R … \r
+363 MINA 1 30 V R … \r
+364 STDEVPA 1 30 V R … \r
+365 VARPA 1 30 V R … \r
+366 STDEVA 1 30 V R … \r
+367 VARA 1 30 V R … \r
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
}
private static void extractFunctionData(FunctionDataCollector fdc, InputStream is) {
- System.setProperty("org.xml.sax.driver", "org.apache.crimson.parser.XMLReaderImpl");
-
XMLReader xr;
+
try {
+ // First up, try the default one
xr = XMLReaderFactory.createXMLReader();
} catch (SAXException e) {
- throw new RuntimeException(e);
+ // Try one for java 1.4
+ System.setProperty("org.xml.sax.driver", "org.apache.crimson.parser.XMLReaderImpl");
+ try {
+ xr = XMLReaderFactory.createXMLReader();
+ } catch (SAXException e2) {
+ throw new RuntimeException(e2);
+ }
}
xr.setContentHandler(new EFFDocHandler(fdc));
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
- PrintStream ps = new PrintStream(os);
+ PrintStream ps = null;
+ try {
+ ps = new PrintStream(os,true, "UTF-8");
+ } catch(UnsupportedEncodingException e) {}
+
outputLicenseHeader(ps);
Class genClass = ExcelFileFormatDocFunctionExtractor.class;
ps.println("# Created by (" + genClass.getName() + ")");