Unknown codepage

Topics: Developer Forum, User Forum
Oct 1, 2010 at 2:36 PM

I have a file that is XLS extension and when I try to upload it to just run it through the iterator sample. I am using this code to get the worksheet:

			$objReader =PHPExcel_IOFactory::createReaderForFile($fileName);
$objPHPExcel = $objReader->load($siteFilePath.$siteFolder."/uploads/".$newFileName);
$sheet = $objPHPExcel->getActiveSheet();

It works fine for most all samples I have tried. But one came back with this message:

Fatal error: Uncaught exception 'Exception' with message 'Unknown codepage: 0' in C:\htdocs\classes\PHPExcel\Shared\CodePage.php:91

I looked in there and realized there is no default case for codepage and am trying to figure out 2 things....

1) Why would a document return a 0 for that?

2) Why is there no default to Unicode or something generic?


Jan 1, 2011 at 11:10 PM

This happens for me, too, with an XLS file created by Apple's Numbers

Jan 1, 2011 at 11:12 PM

https://gist.github.com/762095 is a patch that fixes it for me.