Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magcius committed Aug 11, 2013
1 parent b4ebeb0 commit b821bf9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Tools/CleanFiles.py
@@ -1,5 +1,4 @@

import chardet
import codecs
import os
import glob
Expand Down Expand Up @@ -101,11 +100,7 @@ def main():
for name in glob.glob(pattern):
in__name = name
out_name = name + '.new'

in_str = open(in__name, 'r').read()
encoding = chardet.detect(in_str)

in_ = codecs.open(in__name, 'r', encoding['encoding'])
in_ = codecs.open(in__name, 'r', 'utf8')
out = codecs.open(out_name, 'w', 'utf8')
normalize_ini_file(in_, out)
os.rename(out_name, in__name)
Expand Down

0 comments on commit b821bf9

Please sign in to comment.