This commit is contained in:
Фёдор Подлеснов 2016-10-07 16:01:47 +03:00
parent af80a4f0ec
commit 5dac5a6e19
2 changed files with 3 additions and 2 deletions

View file

@ -26,6 +26,7 @@ class Database extends PDO
if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') { if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') {
$port = (isset($dsn['port'])) ? "port={$dsn['port']};" : ""; $port = (isset($dsn['port'])) ? "port={$dsn['port']};" : "";
$connection = new Database("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']); $connection = new Database("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']);
$connection->query('SET client_encoding = "UTF-8"');
} }
if ($dsn['phptype'] == 'sqlite') { if ($dsn['phptype'] == 'sqlite') {
$connection = new Database("{$dsn['phptype']}:{$dsn['database']}"); $connection = new Database("{$dsn['phptype']}:{$dsn['database']}");

View file

@ -225,7 +225,7 @@ class ExcelTable
function encode($s) function encode($s)
{ {
return iconv("WINDOWS-1251", "UTF-8", $s); return $s;
} }
/** /**
@ -415,7 +415,7 @@ class ExcelDocument {
$doc = new xmlWriter(); $doc = new xmlWriter();
$doc->openURI($filename); $doc->openURI($filename);
$doc->setIndent(false); $doc->setIndent(false);
$doc->startDocument('1.0','windows-1251'); $doc->startDocument('1.0','utf-8');
$doc->startElement('Workbook'); $doc->startElement('Workbook');
$doc->writeAttribute('xmlns', self::$ns); $doc->writeAttribute('xmlns', self::$ns);
$doc->writeAttribute('xmlns:ss', self::$ns); $doc->writeAttribute('xmlns:ss', self::$ns);