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);