summaryrefslogtreecommitdiff
path: root/mg_db_gd_pg.c
diff options
context:
space:
mode:
Diffstat (limited to 'mg_db_gd_pg.c')
-rw-r--r--mg_db_gd_pg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mg_db_gd_pg.c b/mg_db_gd_pg.c
index 05953d3..f41339b 100644
--- a/mg_db_gd_pg.c
+++ b/mg_db_gd_pg.c
@@ -254,6 +254,19 @@ mgDbGd::Commit()
bool
mgDbGd::Create()
{
+
+ if (the_setup.utf8)
+ {
+ const char *cmd;
+ if (the_setup.utf8)
+ cmd="SET NAMES UTF8";
+ else
+ cmd="SET NAMES LATIN1";
+ mgQuery q0(m_db,cmd);
+ if (!q0.ErrorMessage().empty())
+ return false;
+ }
+
// create database and tables
int len = sizeof( db_cmds ) / sizeof( char* );
for( int i=0; i < len; i ++ )