Skip to content

Instantly share code, notes, and snippets.

@beastaugh
Created July 11, 2011 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save beastaugh/1075566 to your computer and use it in GitHub Desktop.
Save beastaugh/1075566 to your computer and use it in GitHub Desktop.
Convert a file from ISO-8859-15 to UTF-8
#!/usr/bin/env ruby
file = ARGV.shift
contents = File.read(file, {:encoding => "ISO-8859-15", :mode => "rb"})
contents.encode!("UTF-8")
File.open(file, 'w') do |f|
f.write(contents)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment