Skip to content

Instantly share code, notes, and snippets.

@youngbrioche
Created August 11, 2011 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youngbrioche/1139417 to your computer and use it in GitHub Desktop.
Save youngbrioche/1139417 to your computer and use it in GitHub Desktop.
test "unicode decoding" do
encoded_val = "\u00C4ffle"
decoded_val = JSON.parse("{\"x\": \"#{encoded_val}\"}")['x'].gsub("\\n", "\n")
assert_equal decoded_val, "Äffle"
end
# 1.9.2 passes
# 1.8.7
# <"u00C4ffle"> expected but was
# <"Äffle">.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment