Answer the question
In order to leave comments, you need to log in
SpreadSheet_Excel_Writer and tabs (sheets) with Russian names
The task was extremely simple. Generate an Excel file based on the data from the table. In principle, nothing is difficult. The PEAR module SpreadSheet_Excel_Writer was taken and tested and launched. And at the end of the work it turned out that in no way can I create a tab (new sheet) with a name in Russian.
Thus, the "New Leaf" will be displayed in krakozyabry, and "Hello, world!" it will be quite comfortable to live on a sheet.
The second day in a row I'm picking. And now, in fact, the question: Has anyone faced such a task? Were you able to implement it? If yes, what library did you use? Or maybe you managed to cure SpreadSheet_Excel_Writer?
<?php
require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer("result.xls");
$workbook->setVersion(8);
$worksheet =& $workbook->addWorksheet("Новый лист1");
$worksheet->setInputEncoding('utf-8');
$worksheet->write(0,0,"Привет, мир!");
$workbook->close();
?>
Answer the question
In order to leave comments, you need to log in
Similarly, the names of the tabs in Russian are not obtained, although in the table itself - no problem.
setInputEncoding is called after the sheet has been created and only affects its content. To name the worksheet, force iconv to be called at 1251
$worksheet =& $workbook->addWorksheet(iconv("UTF-8", "CP1251", "Hi worksheet");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question