Skip to content

Instantly share code, notes, and snippets.

@h3nryza
Created July 17, 2018 16:41
Show Gist options
  • Save h3nryza/cfb09720085ac1230a96b181156721e6 to your computer and use it in GitHub Desktop.
Save h3nryza/cfb09720085ac1230a96b181156721e6 to your computer and use it in GitHub Desktop.
Unicode to string (fix to coercing unicode to string error
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
uni = u'some unicode'
string = uni.encode("utf-8")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment