0

I’m trying to read and parse a UTF-8 Excel file using the PHPExcelReader but unfortunately this does not work correctly and I receive some ???? Instead of UTF-8 characters. Would you please help me about the instructions about the way to handle this situation? I have used this configuration for my parsing:

$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP1251');
$data->setUTFEncoder('mb');

Thanks

1
  • Why CP1251 if you want UTF-8? What characters should it output instead of "???"? Commented Jan 1, 2012 at 11:35

2 Answers 2

1

UTF-8 is the default encoding for Spreadsheet_Excel_Reader...you should not need to change this at all unless you want the values automatically converted to some other charset.

e.g.

$data = new Spreadsheet_Excel_Reader("test.xls",true,"UTF-16");

to convert outputs to UTF-16

Sign up to request clarification or add additional context in comments.

Comments

1

I tried UTF-16 but there's still an error.

Then I tried:

$data->setOutputEncoding('UTF-8');
$data = new Spreadsheet_Excel_Reader("test.xls",true,"UTF-8");

This is ok.

1 Comment

$excel = new PhpExcelReader(); $excel->setOutputEncoding('UTF-8'); This worked for me after hours of different trials. Thank You.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.