CleanFiles: Remove use of chardet

Now that everything is utf8, guessing the character encoding might
go haywire, like with the "Pokemon" games. Just assume UTF8 from
here on out.
This commit is contained in:
Jasper St. Pierre 2013-08-11 11:59:57 -04:00
parent b4ebeb05ff
commit b821bf996e

View File

@ -1,5 +1,4 @@
import chardet
import codecs import codecs
import os import os
import glob import glob
@ -101,11 +100,7 @@ def main():
for name in glob.glob(pattern): for name in glob.glob(pattern):
in__name = name in__name = name
out_name = name + '.new' out_name = name + '.new'
in_ = codecs.open(in__name, 'r', 'utf8')
in_str = open(in__name, 'r').read()
encoding = chardet.detect(in_str)
in_ = codecs.open(in__name, 'r', encoding['encoding'])
out = codecs.open(out_name, 'w', 'utf8') out = codecs.open(out_name, 'w', 'utf8')
normalize_ini_file(in_, out) normalize_ini_file(in_, out)
os.rename(out_name, in__name) os.rename(out_name, in__name)