Browse files

migrators now open Sequel connection to mysql with utf8 encoding. Clo…

…ses GH-220
  • Loading branch information...
1 parent 38ed81e commit 9396c9d04c9c64458dbd5348d38edcd8a8b19d17 @tomash tomash committed Nov 18, 2010
View
2 lib/jekyll/migrators/mephisto.rb
@@ -40,7 +40,7 @@ def self.postgres(c)
QUERY = "SELECT id, permalink, body, published_at, title FROM contents WHERE user_id = 1 AND type = 'Article' AND published_at IS NOT NULL ORDER BY published_at"
def self.process(dbname, user, pass, host = 'localhost')
- db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
FileUtils.mkdir_p "_posts"
View
2 lib/jekyll/migrators/mt.rb
@@ -20,7 +20,7 @@ module MT
QUERY = "SELECT entry_id, entry_basename, entry_text, entry_text_more, entry_created_on, entry_title FROM mt_entry"
def self.process(dbname, user, pass, host = 'localhost')
- db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
FileUtils.mkdir_p "_posts"
View
2 lib/jekyll/migrators/textpattern.rb
@@ -17,7 +17,7 @@ module TextPattern
QUERY = "select Title, url_title, Posted, Body, Keywords from textpattern where Status = '4' or Status = '5'"
def self.process(dbname, user, pass, host = 'localhost')
- db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
FileUtils.mkdir_p "_posts"
View
2 lib/jekyll/migrators/typo.rb
@@ -22,7 +22,7 @@ module Typo
def self.process dbname, user, pass, host='localhost'
FileUtils.mkdir_p '_posts'
- db = Sequel.mysql dbname, :user => user, :password => pass, :host => host
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
db[SQL].each do |post|
next unless post[:state] =~ /Published/
View
2 lib/jekyll/migrators/wordpress.rb
@@ -19,7 +19,7 @@ module WordPress
QUERY = "select post_title, post_name, post_date, post_content, post_excerpt, ID, guid from wp_posts where post_status = 'publish' and post_type = 'post'"
def self.process(dbname, user, pass, host = 'localhost')
- db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host)
+ db = Sequel.mysql(dbname, :user => user, :password => pass, :host => host, :encoding => 'utf8')
FileUtils.mkdir_p "_posts"

0 comments on commit 9396c9d

Please sign in to comment.