Data truncated after fraction

Topics: User Forum
Feb 19, 2012 at 5:11 PM

I am processing (reading only) a CSV file with phpExcel v1.7.6 on Mac OS X with PHP v5.3.8

Certain cells have fractions in the data eg -> 'PROGEL WOMEN'S ¾ KNICKERS   10'

When I read the data ($cell->getValue()) from these cells all data from the fraction onwards is removed so what is returned in the above example is 'PROGEL WOMEN'S '

Is this a bug?

TIA

Rich

Coordinator
Feb 19, 2012 at 8:56 PM

Ensure you identify the correct charset encoding when loading the file so that the CSV reader can convert it to UTF-8. By default, the CSV reader assumes UTF-8 already.

Feb 19, 2012 at 9:23 PM

Hi Mark

Thanks for the pointer - so how do I do that? Sorry to be so dense!

Rich

Coordinator
Feb 19, 2012 at 10:47 PM

Something like:

$objReader = PHPExcel_IOFactory::createReader('CSV');
$objReader->setInputEncoding('CP1252');

depending on the charset/codepage of the input file.