Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
Index: /Users/duff/Library/Application Support/TextMate/Bundles/SQL.tmbundle/Support/lib/connectors/mysql.rb =================================================================== --- /Users/duff/Library/Application Support/TextMate/Bundles/SQL.tmbundle/Support/lib/connectors/mysql.rb (revision 7751) +++ /Users/duff/Library/Application Support/TextMate/Bundles/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_client AS client, @@character_set_database AS server').fetch_hash + query('SET NAMES utf8;') if encoding["client"] != encoding["server"] end def real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, socket=nil, flag=nil)
From the Design Piracy series on my blog: