Hi I’m developing a tool that will read in data from an Excel sheet and produce XML files from the data.
Doing this I’ve found a problem. The Excel has changed some of the character into special characters that PHP can’t read.
For Example
EXCEL DATA “Czy przedstawiono Ci instrukcję bezpieczeństwa i higieny pracy (BHP) obowiązującą w firmie?”
Out Put Data “W którym miejscu najlepiej umie[ ci stopy przed podniesieniem ci | aru?W którym miejscu najlepiej umie[ ci stopy przed podniesieniem ci | aru?”
As you can see above it has changed!
I’m using PHP 4 and the below method to read and produce the Output
Does anyone know how I can fix this problem???PHP Code:$data = new Spreadsheet_Excel_Reader();
$data->setUTFEncoder('iconv');
$data->setOutputEncoding("CP-1251");
//$data->setOutputEncoding("UTF-8");
error_reporting(E_ALL ^ E_NOTICE);
$ value = checker($data->sheets[1]['cells'][$j+1][2]);
$newphrase = html_entity_decode($value);
Thanks


Reply With Quote

Bookmarks