How to out put charset=iso-8859-1 in an excel reader for php?

3.1k views Asked by At

the code have this one

$retstr = ($asciiEncoding) ? $retstr : $this->_encodeUTF16($retstr);

, but i want to change it on charset=iso-8859-1 ... caracters like ë , ' " , out put are wrong symbols .

Please any idea?

1

There are 1 answers

1
Mark Baker On

The first few lines of the documentation say how to do this using the php-excel-reader library itself when you actually read the file:

$data = new Spreadsheet_Excel_Reader("test.xls", true, "ISO-8859-1"); 

Otherwise, it defaults to UTF-8, and you can convert strings individually from UTF-8 to ISO-8859-1 using:

$str = mb_convert_encoding($str, "ISO-8859-1", "UTF-8");