mysql: set connection charset to utf-8

This commit is contained in:
Andrew Dolgov 2007-08-17 17:02:15 +01:00
parent 981e8107ca
commit 70dcff6b3d
6 changed files with 19 additions and 1 deletions

View File

@ -49,6 +49,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query("set client_encoding = 'UTF-8'"); pg_query("set client_encoding = 'UTF-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
$op = $_REQUEST["op"]; $op = $_REQUEST["op"];

View File

@ -13,6 +13,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query($link, "set client_encoding = 'utf-8'"); pg_query($link, "set client_encoding = 'utf-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
login_sequence($link); login_sequence($link);

View File

@ -13,6 +13,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query($link, "set client_encoding = 'utf-8'"); pg_query($link, "set client_encoding = 'utf-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
login_sequence($link); login_sequence($link);

View File

@ -65,6 +65,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query("set client_encoding = 'utf-8'"); pg_query("set client_encoding = 'utf-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
$last_purge = 0; $last_purge = 0;

View File

@ -26,6 +26,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query("set client_encoding = 'utf-8'"); pg_query("set client_encoding = 'utf-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
$result = db_query($link, "SELECT id FROM ttrss_users"); $result = db_query($link, "SELECT id FROM ttrss_users");

View File

@ -22,6 +22,9 @@
if (DB_TYPE == "pgsql") { if (DB_TYPE == "pgsql") {
pg_query("set client_encoding = 'utf-8'"); pg_query("set client_encoding = 'utf-8'");
pg_set_client_encoding("UNICODE"); pg_set_client_encoding("UNICODE");
} else {
db_query($link, "SET NAMES utf8");
db_query($link, "SET CHARACTER SET utf8");
} }
function getVirtualFeeds($msg) { function getVirtualFeeds($msg) {