Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created June 1, 2011 17:07
Show Gist options
  • Save tenderlove/1002777 to your computer and use it in GitHub Desktop.
Save tenderlove/1002777 to your computer and use it in GitHub Desktop.
# encoding: utf-8
Encoding.default_external = 'utf-8'
Encoding.default_internal = 'utf-8'
ENV["LANG"] = 'en_US.UTF-8'
require 'psych' if ARGV.first == 'p'
require 'yaml'
puts 'hello: "h\xc3\xa4gar"'
__END__
data = YAML.load('hello: "h\xc3\xa4gar"')
p YAML.name
p data['hello'].encoding
p data['hello']
puts data['hello'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment