1
2
3
4
5
6
7
8
9
10
11
12
13
14
Index: SQL.tmbundle/Support/lib/connectors/mysql.rb
===================================================================
--- SQL.tmbundle/Support/lib/connectors/mysql.rb   (revision 7751)
+++ SQL.tmbundle/Support/lib/connectors/mysql.rb   (working copy)
@@ -98,6 +98,9 @@
     if args[0] != :INIT then
       real_connect(*args)
     end
+
+    encoding = query('SELECT @@character_set_database AS server').fetch_hash
+    query('SET NAMES utf8;') if encoding["server"] != 'latin1'
   end
 
   def real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=nil)