Skip to content

Instantly share code, notes, and snippets.

@ursm
Created June 10, 2009 02:29
Show Gist options
  • Select an option

  • Save ursm/126977 to your computer and use it in GitHub Desktop.

Select an option

Save ursm/126977 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# encoding: utf-8
require 'nkf'
sjis_str = File.read(ARGV.shift)
puts NKF.nkf('-wx -Lu --no-best-fit-chars', sjis_str.gsub(/\201\174/, '__-__')).gsub(/__-__/, '-')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment