Skip to content

Instantly share code, notes, and snippets.

@kazgoto
Last active December 28, 2017 16:13
Show Gist options
  • Save kazgoto/1750e50dab1c32019298 to your computer and use it in GitHub Desktop.
Save kazgoto/1750e50dab1c32019298 to your computer and use it in GitHub Desktop.
Ruby One Liner to unescape unicode chars in JSON
cat unicode-escaped.json | ruby -ne 'puts $_.gsub(/\\u([\da-fA-F]{4})/) { [$1].pack("H*").unpack("n*").pack("U*") }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment