Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Created July 3, 2015 09:57
Show Gist options
  • Save ptantiku/26ea74190a4c8390037c to your computer and use it in GitHub Desktop.
Save ptantiku/26ea74190a4c8390037c to your computer and use it in GitHub Desktop.
Convert input.txt to all encoding available in iconv
#!/usr/bin/env ruby
list=`iconv -l`.gsub(/[ \n]/,'').split('//')
list.each do |encode|
out = `iconv input.txt -f #{encode} -c -t UTF-8`
puts "#{encode}\t#{out}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment