Skip to content

Instantly share code, notes, and snippets.

@imonyse
Created December 9, 2011 03:47
Show Gist options
  • Save imonyse/1450057 to your computer and use it in GitHub Desktop.
Save imonyse/1450057 to your computer and use it in GitHub Desktop.
A Script that convert all GB18030 encoding text files under current directory
#!/usr/bin/env ruby
#-*- coding:utf-8 -*-
Dir.foreach('.') do |n|
if n != 'convert.rb' and n != '.' and n != '..'
`iconv -f gb18030 -t utf-8 < #{n} > u.txt && mv u.txt #{n}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment