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/bin/db_browser.rb =================================================================== --- /Users/duff/Library/Application Support/TextMate/Bundles/SQL.tmbundle/Support/bin/db_browser.rb (revision 7751) +++ /Users/duff/Library/Application Support/TextMate/Bundles/SQL.tmbundle/Support/bin/db_browser.rb (working copy) @@ -3,6 +3,7 @@ require 'optparse' require 'ostruct' require 'erb' +require 'iconv' require File.dirname(__FILE__) + '/db_browser_lib' require 'cgi' require "#{ENV["TM_SUPPORT_PATH"]}/lib/web_preview" if ENV["TM_SUPPORT_PATH"] @@ -134,6 +135,11 @@ def format(content, type) return '' unless content + begin + Iconv.iconv('utf-8', 'utf-8', content) + rescue Exception => e + content = '(unknown encoding)' + end if type == :number content else
From the Design Piracy series on my blog: