Skip to content

Instantly share code, notes, and snippets.

@bcse bcse/remove_utf16.py
Created Jun 19, 2013

Embed
What would you like to do?
Remove all UTF-16 characters by regular expression
txt = u'\U0001f600'
r = re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]')
r.sub('', txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.