mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-07 10:34:54 -06:00
Minor mysql encoding improvement... (to be sure, we call mysql_set_character_set too)
git-svn-id: svn://ultimatepp.org/upp/trunk@362 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
2fe3327c8e
commit
bbfb17d214
1 changed files with 3 additions and 2 deletions
|
|
@ -47,10 +47,11 @@ bool MySqlSession::Connect(const char *user, const char *password, const char *d
|
|||
const char *host, int port, const char *socket) {
|
||||
mysql = mysql_init((MYSQL*) 0);
|
||||
if(mysql && mysql_real_connect(mysql, sEmpNull(host), sEmpNull(user),
|
||||
sEmpNull(password), sEmpNull(database), port,
|
||||
sEmpNull(socket), 0)) {
|
||||
sEmpNull(password), sEmpNull(database), port,
|
||||
sEmpNull(socket), 0)) {
|
||||
Sql sql(*this);
|
||||
username = sql.Select("substring_index(USER(),'@',1)");
|
||||
mysql_set_character_set(mysql, "utf8");
|
||||
sql.Execute("SET NAMES 'utf8'");
|
||||
sql.Execute("SET CHARACTER SET utf8");
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue