Skip to content

Instantly share code, notes, and snippets.

@Groxx
Created November 5, 2012 23:45
Show Gist options
  • Save Groxx/4021202 to your computer and use it in GitHub Desktop.
Save Groxx/4021202 to your computer and use it in GitHub Desktop.
>> h = {
:jpn=>"日本語",
:abc=>{:jpn=>"日本語"}.with_indifferent_access,
:xyz=>{:jpn=>"日本語"}
}
>> JSON.generate(h)
# => "{\"abc\":{\"jpn\":\"\\u65e5\\u672c\\u8a9e\"},\"jpn\":\"日本語\",\"xyz\":{\"jpn\":\"日本語\"}}"
>> http://cl.ly/image/2X0l0s1y0v2T
SyntaxError: compile error
(irb):32: syntax error, unexpected tCONSTANT, expecting $end
from (irb):32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment