Skip to content

Instantly share code, notes, and snippets.

@knzm
Created April 19, 2012 07:26
Show Gist options
  • Select an option

  • Save knzm/2419392 to your computer and use it in GitHub Desktop.

Select an option

Save knzm/2419392 to your computer and use it in GitHub Desktop.
import re
def fix_charref(s):
return re.sub(r'&#(\d+);', lambda m: unichr(int(m.group(1))), s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment