From 037b9cd6f81580ba4ef1241fa252a3037bca4e30 Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 11 Apr 2005 20:06:53 +0000 Subject: [PATCH] put connection into UTF-8 mode git-svn-id: http://svn.opengroupware.org/SOPE/trunk@726 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/MySQL4/MySQL4Channel.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sope-gdl1/MySQL4/MySQL4Channel.m b/sope-gdl1/MySQL4/MySQL4Channel.m index db1d80e8..a61889ee 100644 --- a/sope-gdl1/MySQL4/MySQL4Channel.m +++ b/sope-gdl1/MySQL4/MySQL4Channel.m @@ -163,13 +163,21 @@ static int openConnectionCount = 0; [socket cString], 0); if (rc == NULL) { - NSLog(@"WARNING: could not open MySQL4 connection to database '%@': %s", + NSLog(@"ERROR: could not open MySQL4 connection to database '%@': %s", [adaptor databaseName], mysql_error(self->_connection)); mysql_close(self->_connection); self->_connection = NULL; return NO; } + if (mysql_query(self->_connection, "SET CHARACTER SET utf8") != 0) { + NSLog(@"ERROR: could not put MySQL4 connection into UTF-8 mode: %s", + mysql_error(self->_connection)); + mysql_close(self->_connection); + self->_connection = NULL; + return NO; + } + if (isDebuggingEnabled) NSLog(@"MySQL4 connection established 0x%08X", self->_connection); -- 2.39.5