Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# encoding: shift_jis
require 'yaml'
require 'tempfile'
t =['shiftjis', 'yml'], :encoding => 'SHIFT_JIS')
t.write '--- こんにちは!'
# If the external encoding isn't utf8, utf16le, or utf16be, we cannot
# process the file., 'r', :encoding => 'SHIFT_JIS') do |f|
YAML.load(f) # ArgumentError が例外発生する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment