PHPExcel 转换器无法正常工作

PHPExcel converter not working fine

我尝试使用 PHPExcel 工具将 csv 转换为 xlsx,当我 运行 脚本出现错误并且转换后 excel 文件中出现了中文字体: Error PHP EXECL 这是我的代码:

<?php
include 'PHPExcel/PHPExcel/IOFactory.php';

$objReader = PHPExcel_IOFactory::createReader('CSV');

// If the files uses a delimiter other than a comma (e.g. a tab), then tell the reader
$objReader->setDelimiter("\t");
// If the files uses an encoding other than UTF-8 or ASCII, then tell the reader
$objReader->setInputEncoding('UTF-16LE');

$objPHPExcel = $objReader->load('myfilebeforeconvert.csv');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('afterconvert.xls');

我有什么错?请告诉我

您提供的信息很少,但您可以查看此example for help

这可能也有帮助,