Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created March 25, 2012 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myronmarston/2196661 to your computer and use it in GitHub Desktop.
Save myronmarston/2196661 to your computer and use it in GitHub Desktop.
require 'yaml'
string = "a string".force_encoding("ASCII-8BIT")
puts YAML.dump(string)
➜ rvm use 1.9.2
Using /Users/myron/.rvm/gems/ruby-1.9.2-p290
➜ ruby foo.rb
--- a string
➜ rvm use 1.9.3
Using /Users/myron/.rvm/gems/ruby-1.9.3-p125
➜ ruby foo.rb
--- !binary |-
YSBzdHJpbmc=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment