Skip to content

Instantly share code, notes, and snippets.

@etrepum
Created September 2, 2011 20:45
Show Gist options
  • Save etrepum/1189868 to your computer and use it in GitHub Desktop.
Save etrepum/1189868 to your computer and use it in GitHub Desktop.
twisted unicode hatred
>>> buffer(u'fuck you', 0, 10)[:]
'f\x00u\x00c\x00k\x00 \x00'
>>> from cStringIO import StringIO
>>> sio = StringIO(); sio.write(u'fuck you'); sio.getvalue()
'fuck you'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment