Skip to content

Instantly share code, notes, and snippets.

View DriesS's full-sized avatar

Dries Steenhouwer DriesS

View GitHub Profile
require 'mysql'
class Mysql::Result
def encode(value, encoding = "utf-8")
String === value ? value.force_encoding(encoding) : value
end
def each_utf8(&block)
each_orig do |row|
yield row.map {|col| encode(col) }