Skip to content

Instantly share code, notes, and snippets.

@niktto
Created May 1, 2012 22:00
Show Gist options
  • Save niktto/2571772 to your computer and use it in GitHub Desktop.
Save niktto/2571772 to your computer and use it in GitHub Desktop.
Simple script to fix QNapi subtitles
#!/usr/bin/python3
import codecs
import sys
try:
inp = codecs.open(sys.argv[1],'r','cp1250')
except IndexError:
print('You need to give me text file with qnapi subtitles as an argument. Thanks.')
else:
sub = inp.read()
inp.close()
outp = codecs.open(sys.argv[1],'w','UTF-8')
outp.write(sub)
outp.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment