Skip to content

Instantly share code, notes, and snippets.

@hellpanderrr
Created February 11, 2016 06:36
Show Gist options
  • Save hellpanderrr/738dde24b1910b6dd545 to your computer and use it in GitHub Desktop.
Save hellpanderrr/738dde24b1910b6dd545 to your computer and use it in GitHub Desktop.
Read Cyrillic from PyPDF2
def fix_string(string):
ret = ''
for char in string:
try:
ret += char.encode('cp1252').decode('cp1251')
except:
ret += char
return ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment