From 5dac5a6e19c5ec034a97f5df5d74b111a3d9962b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=91=D0=B4=D0=BE=D1=80=20=D0=9F=D0=BE=D0=B4=D0=BB?= =?UTF-8?q?=D0=B5=D1=81=D0=BD=D0=BE=D0=B2?= Date: Fri, 7 Oct 2016 16:01:47 +0300 Subject: [PATCH] utf-8 --- core/database_pdo.php | 1 + core/tools/exceltable.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/database_pdo.php b/core/database_pdo.php index 036f39e..21c1285 100644 --- a/core/database_pdo.php +++ b/core/database_pdo.php @@ -26,6 +26,7 @@ class Database extends PDO if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') { $port = (isset($dsn['port'])) ? "port={$dsn['port']};" : ""; $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') { $connection = new Database("{$dsn['phptype']}:{$dsn['database']}"); diff --git a/core/tools/exceltable.php b/core/tools/exceltable.php index ded9278..0816ee8 100644 --- a/core/tools/exceltable.php +++ b/core/tools/exceltable.php @@ -225,7 +225,7 @@ class ExcelTable function encode($s) { - return iconv("WINDOWS-1251", "UTF-8", $s); + return $s; } /** @@ -415,7 +415,7 @@ class ExcelDocument { $doc = new xmlWriter(); $doc->openURI($filename); $doc->setIndent(false); - $doc->startDocument('1.0','windows-1251'); + $doc->startDocument('1.0','utf-8'); $doc->startElement('Workbook'); $doc->writeAttribute('xmlns', self::$ns); $doc->writeAttribute('xmlns:ss', self::$ns);