Skip to content

Instantly share code, notes, and snippets.

@holysugar
Created September 20, 2013 05:07
Show Gist options
  • Select an option

  • Save holysugar/6633513 to your computer and use it in GitHub Desktop.

Select an option

Save holysugar/6633513 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
w = "〜"
puts w.encode('Shift_JIS')
puts w.encode('CP932')
# $ ruby sjis.txt| nkf -Sw
# sjis.txt:6:in `encode': U+301C from UTF-8 to Windows-31J (Encoding::UndefinedConversionError)
# from sjis.txt:6:in `<main>'
# 〜
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment