Skip to content

Commit

Permalink
migrators now open Sequel connection to mysql with utf8 encoding. Closes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomash committed Nov 18, 2010
1 parent 38ed81e commit 9396c9d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/jekyll/migrators/mephisto.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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" 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') 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" FileUtils.mkdir_p "_posts"


Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/migrators/mt.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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" 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') 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" FileUtils.mkdir_p "_posts"


Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/migrators/textpattern.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module TextPattern
QUERY = "select Title, url_title, Posted, Body, Keywords from textpattern where Status = '4' or Status = '5'" QUERY = "select Title, url_title, Posted, Body, Keywords from textpattern where Status = '4' or Status = '5'"


def self.process(dbname, user, pass, host = 'localhost') 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" FileUtils.mkdir_p "_posts"


Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/migrators/typo.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Typo


def self.process dbname, user, pass, host='localhost' def self.process dbname, user, pass, host='localhost'
FileUtils.mkdir_p '_posts' 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| db[SQL].each do |post|
next unless post[:state] =~ /Published/ next unless post[:state] =~ /Published/


Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/migrators/wordpress.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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'" 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') 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" FileUtils.mkdir_p "_posts"


Expand Down

0 comments on commit 9396c9d

Please sign in to comment.