Skip to content

Instantly share code, notes, and snippets.

@Sixeight
Created February 20, 2009 15:33
Show Gist options
  • Save Sixeight/67515 to your computer and use it in GitHub Desktop.
Save Sixeight/67515 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
# -*- conding: utf-8 -*-
require 'nkf'
unless ARGV.size == 1
warn 'pleese set directory'
exit
end
Dir["#{ARGV[0]}/*.html"].each do |f|
puts "converting #{f}..."
File.open(f, 'rb+') do |io|
body = NKF.nkf('-wS', io.read)
io.rewind
io.write body
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment