Skip to content

Instantly share code, notes, and snippets.

@softcraft-development
Created October 14, 2009 00:22
Show Gist options
  • Save softcraft-development/209690 to your computer and use it in GitHub Desktop.
Save softcraft-development/209690 to your computer and use it in GitHub Desktop.
#!/bin/ruby
require 'fileutils'
files = Dir['*.sql']
files.each do |file|
p file
typestring = `file #{file}`
if !typestring.include? "ASCII"
output = `iconv -f UCS-2 -t UTF-8 #{file}`
File.open(file, "w") do |f|
f.write output
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment