Created
December 23, 2010 15:20
-
-
Save rogercampos/753106 to your computer and use it in GitHub Desktop.
Encode input files to ut8 from iso-8859-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
files = ARGV.select do |x| | |
`file -i #{x} | grep iso-8859-1` != '' | |
end | |
files.each do |file| | |
`iconv -f iso-8859-1 -t utf-8 #{file} > aux` | |
`mv aux #{file}` | |
puts "Converted #{file}" | |
end | |
puts "#{files.size} files converted to utf-8" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment