php setlocale() & PHPExcel

Aug 8, 2008 at 8:07 AM
Today I opened a strainge feature. The following part of code works well on one server (Windows) and gets out a broken file under another (Unix).

setlocale(LC_ALL, "ru_RU.CP1251");
require_once  'PHPExcel/IOFactory.php';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("template/invoice.xlsx");
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

I was spending a half day trying to understand the reason and found it.
After commenting the first line the code works on both servers well.

What should I do to start this code under second server?
Aug 8, 2008 at 10:50 AM
There was a locale bug in PHPExcel 1.6.2, but that was fixed.

Are you using the latest source code?
Aug 11, 2008 at 7:48 AM

Today I was downloading the latest sources (Change Set 15344 from 25, July).
But nothing was changed. As before writer works well only without setlocale() on UNIX server and with/without setlocale() on local Windows server.

I have uploaded both files in