From: Andrew Dolgov Date: Tue, 21 Aug 2007 10:47:25 +0000 (+0100) Subject: new config option: MYSQL_CHARSET X-Git-Tag: 1.2.14.2~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bddc9788ef5c572818b19a8bfa369dc464f5482b;p=tt-rss.git new config option: MYSQL_CHARSET --- diff --git a/backend.php b/backend.php index bbfa8ca2..4b749f9a 100644 --- a/backend.php +++ b/backend.php @@ -50,8 +50,10 @@ pg_query("set client_encoding = 'UTF-8'"); pg_set_client_encoding("UNICODE"); } else { -// db_query($link, "SET NAMES utf8"); -// db_query($link, "SET CHARACTER SET utf8"); + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } $op = $_REQUEST["op"]; diff --git a/config.php-dist b/config.php-dist index 5c6d3c1c..295a30d5 100644 --- a/config.php-dist +++ b/config.php-dist @@ -146,7 +146,11 @@ // Enable experimental support for interface translations // based on PHP-Gettext. This is of no much use right now. - define('CONFIG_VERSION', 7); + define('MYSQL_CHARSET', ''); + // Connection charset for MySQL. Only enable if having charset-related + // errors with MySQL (mangled characters, errors when updating feeds, etc). + + define('CONFIG_VERSION', 8); // Expected config version. Please update this option in config.php // if necessary (after migrating all new options from this file). diff --git a/locale/fr_FR/LC_MESSAGES/messages.mo b/locale/fr_FR/LC_MESSAGES/messages.mo index 33767129..4593e9ca 100644 Binary files a/locale/fr_FR/LC_MESSAGES/messages.mo and b/locale/fr_FR/LC_MESSAGES/messages.mo differ diff --git a/locale/fr_FR/LC_MESSAGES/messages.po b/locale/fr_FR/LC_MESSAGES/messages.po index 50a23b2f..0a2b8ebc 100644 --- a/locale/fr_FR/LC_MESSAGES/messages.po +++ b/locale/fr_FR/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-08-21 18:35+0400\n" +"POT-Creation-Date: 2007-08-21 18:36+0400\n" "PO-Revision-Date: 2007-08-21 12:37+0200\n" "Last-Translator: Thibaut Cousin \n" "Language-Team: Français \n" @@ -1112,6 +1112,10 @@ msgstr "La base de données de Tiny Tiny RSS est à jour." msgid "Return to Tiny Tiny RSS" msgstr "Revenir à Tiny Tiny RSS" +#: update.php:109 +msgid "Please backup your database before proceeding." +msgstr "" + #: update.php:111 #, php-format msgid "" diff --git a/locale/ru_RU/LC_MESSAGES/messages.mo b/locale/ru_RU/LC_MESSAGES/messages.mo index 34ba903d..ad4d44d2 100644 Binary files a/locale/ru_RU/LC_MESSAGES/messages.mo and b/locale/ru_RU/LC_MESSAGES/messages.mo differ diff --git a/locale/ru_RU/LC_MESSAGES/messages.po b/locale/ru_RU/LC_MESSAGES/messages.po index c071ac46..037b2086 100644 --- a/locale/ru_RU/LC_MESSAGES/messages.po +++ b/locale/ru_RU/LC_MESSAGES/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-08-21 18:35+0400\n" +"POT-Creation-Date: 2007-08-21 18:36+0400\n" "PO-Revision-Date: 2007-08-18 15:14+0400\n" "Last-Translator: Andrew Dolgov \n" "Language-Team: Русский \n" @@ -1051,6 +1051,11 @@ msgstr "" msgid "Return to Tiny Tiny RSS" msgstr "Вернуться к Tiny Tiny RSS" +#: update.php:109 +#, fuzzy +msgid "Please backup your database before proceeding." +msgstr "Внимание: Сохраните базу данных перед продолжением." + #: update.php:111 #, php-format msgid "" @@ -1723,9 +1728,6 @@ msgstr "Сбросить пароль" #~ msgid "Label search results" #~ msgstr "Результаты поиска" -#~ msgid "Warning: Please backup your database before proceeding." -#~ msgstr "Внимание: Сохраните базу данных перед продолжением." - #~ msgid "Help" #~ msgstr "Помощь" diff --git a/locale/zh_CN/LC_MESSAGES/messages.mo b/locale/zh_CN/LC_MESSAGES/messages.mo index deb8c8c1..9eba09f7 100644 Binary files a/locale/zh_CN/LC_MESSAGES/messages.mo and b/locale/zh_CN/LC_MESSAGES/messages.mo differ diff --git a/locale/zh_CN/LC_MESSAGES/messages.po b/locale/zh_CN/LC_MESSAGES/messages.po index 3da01b69..f2573766 100644 --- a/locale/zh_CN/LC_MESSAGES/messages.po +++ b/locale/zh_CN/LC_MESSAGES/messages.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: Tiny Tiny RSS1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-08-21 18:35+0400\n" +"POT-Creation-Date: 2007-08-21 18:36+0400\n" "PO-Revision-Date: 2007-08-19 19:03+0800\n" "Last-Translator: sluke \n" "Language-Team: hicode.org \n" @@ -1058,6 +1058,10 @@ msgstr "Tiny Tiny RSS 数据库是最新版。" msgid "Return to Tiny Tiny RSS" msgstr "返回Tiny Tiny RSS" +#: update.php:109 +msgid "Please backup your database before proceeding." +msgstr "" + #: update.php:111 #, php-format msgid "" diff --git a/opml.php b/opml.php index f5655cb3..ce7b490b 100644 --- a/opml.php +++ b/opml.php @@ -14,8 +14,10 @@ pg_query($link, "set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); } else { -// db_query($link, "SET NAMES utf8"); -// db_query($link, "SET CHARACTER SET utf8"); + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } login_sequence($link); diff --git a/sanity_check.php b/sanity_check.php index b1c145d2..7d41ea73 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -1,7 +1,7 @@ " . T_sprintf("Your Tiny Tiny RSS database needs update to the latest version (%d to %d).", $version, $latest_version) . "

"; diff --git a/update_daemon.php b/update_daemon.php index c2738e48..e7f1f401 100644 --- a/update_daemon.php +++ b/update_daemon.php @@ -66,8 +66,10 @@ pg_query("set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); } else { -// db_query($link, "SET NAMES utf8"); -// db_query($link, "SET CHARACTER SET utf8"); + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } $last_purge = 0; diff --git a/update_feeds.php b/update_feeds.php index 2fd74ef1..9a1b8f43 100644 --- a/update_feeds.php +++ b/update_feeds.php @@ -27,8 +27,10 @@ pg_query("set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); } else { -// db_query($link, "SET NAMES utf8"); -// db_query($link, "SET CHARACTER SET utf8"); + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } $result = db_query($link, "SELECT id FROM ttrss_users"); diff --git a/xml-rpc.php b/xml-rpc.php index 21237f6c..affb09d0 100644 --- a/xml-rpc.php +++ b/xml-rpc.php @@ -23,8 +23,10 @@ pg_query("set client_encoding = 'utf-8'"); pg_set_client_encoding("UNICODE"); } else { -// db_query($link, "SET NAMES utf8"); -// db_query($link, "SET CHARACTER SET utf8"); + if (defined('MYSQL_CHARSET') && MYSQL_CHARSET) { + db_query($link, "SET NAMES " . MYSQL_CHARSET); + db_query($link, "SET CHARACTER SET " . MYSQL_CHARSET); + } } function getVirtualFeeds($msg) {