简体   繁体   中英

Spreadsheet_Excel_Reader (PHPExcelReader) fails on accent encoding

I'm using Spreadsheet_Excel_Reader for reading Excel file in my PHP app. It works fine until I put some accents in my Excel file, they are not correctly handled : "éçà@" for example. I've seen that encoding can be set through :

$reader->setOutputEncoding($encoding);

But this doesn't seem to change anything.

Line 562

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

edit this way

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

I used

$data->setOutputEncoding('UTF8');

and it is working fine for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM