Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created November 6, 2011 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonleighton/1342729 to your computer and use it in GitHub Desktop.
Save jonleighton/1342729 to your computer and use it in GitHub Desktop.
conversions = {}
Encoding.list.each do |from|
Encoding.list.each do |to|
if from != to
begin
Encoding::Converter.new(from, to)
rescue Encoding::ConverterNotFoundError
else
conversions[from.to_s] ||= []
conversions[from.to_s] << to.to_s
end
end
end
end
puts Marshal.dump(conversions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment