import org.apache.poi.poifs.filesystem.Entry;
import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
+import org.apache.poi.util.CodePageUtil;
import org.apache.poi.util.HexDump;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.RLEDecompressingInputStream;
break;
case PROJECTCODEPAGE:
int codepage = in.readShort();
- modules.charset = Charset.forName("Cp" + codepage);
+ modules.charset = Charset.forName(CodePageUtil.codepageToEncoding(codepage, true));
break;
case STREAMNAME:
streamName = readString(in, recordLength, modules.charset);
assertNotNull(macros.get("NewMacros"));
assertContains(macros.get("NewMacros"), "' dirty");
}
+
+ @Test
+ public void bug60273() throws IOException {
+ //test file derives from govdocs1 147240.xls
+ File f = POIDataSamples.getSpreadSheetInstance().getFile("60273.xls");
+ VBAMacroReader r = new VBAMacroReader(f);
+ Map<String, String> macros = r.readMacros();
+ assertNotNull(macros.get("Module1"));
+ assertContains(macros.get("Module1"), "9/8/2004");
+ }
}