Skip to content

Instantly share code, notes, and snippets.

@guelfoweb
Created March 1, 2016 11:38
Show Gist options
  • Select an option

  • Save guelfoweb/1b7c4ecc3a2a7d8947ad to your computer and use it in GitHub Desktop.

Select an option

Save guelfoweb/1b7c4ecc3a2a7d8947ad to your computer and use it in GitHub Desktop.
import re
filename = 'SCAN000189077.js'
with open(filename, 'r') as file:
data = file.read().split('\n')
for str in data:
uMatch = re.findall('\\\u[0-9]{3}[0-9a-fA-F]{1}', str)
for u in uMatch:
str = str.replace(u, u.decode('unicode-escape'))
print (str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment