Skip to content

Instantly share code, notes, and snippets.

@markiz
Created May 17, 2012 16:13
Show Gist options
  • Save markiz/d435380e15283e3984bb to your computer and use it in GitHub Desktop.
Save markiz/d435380e15283e3984bb to your computer and use it in GitHub Desktop.
1.9.3-p194 :004 > s = "фывasd".encode(Encoding::UTF_16LE)
=> "\u0444\u044B\u0432asd"
1.9.3-p194 :010 > hash = {s => s}
=> {"\u0444\u044B\u0432asd"=>"\u0444\u044B\u0432asd"}
1.9.3-p194 :012 > require 'yaml'
=> true
1.9.3-p194 :013 > YAML
=> Psych
1.9.3-p194 :015 > YAML.dump hash
Encoding::CompatibilityError: incompatible character encodings: UTF-16LE and US-ASCII
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment