Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shhider/1c580e526c11ae73b28f8eddebc68f46 to your computer and use it in GitHub Desktop.
Save shhider/1c580e526c11ae73b28f8eddebc68f46 to your computer and use it in GitHub Desktop.
aaa = u'你好'
result = ''
for i in range(len(aaa)):
item = hex(ord(aaa[i]))
item = str(item)[2:]
item = item.upper()
item = item.zfill(4)
result = result + item
print result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment