Skip to content

Instantly share code, notes, and snippets.

@luikore
Created December 26, 2010 04:33
Show Gist options
  • Save luikore/755215 to your computer and use it in GitHub Desktop.
Save luikore/755215 to your computer and use it in GitHub Desktop.
hex string to bytes and codepoint
"\xae\xd3\x8f"
['AED38F'].pack('H*')
"\u4e2d"
['4e2d'].pack('H*').force_encoding('utf-16be').encode!('gbk')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment