Filter chars under \x20

This commit is contained in:
Star Brilliant 2013-11-03 22:58:05 +08:00
parent 6e7abd7406
commit e5bf232253

View File

@ -336,7 +336,7 @@ def ConvertToFile(filename_or_file, *args, **kwargs):
def FilterBadChars(f): def FilterBadChars(f):
s = f.read() s = f.read()
s = re.sub('[\\x00-\\x19]', '\ufffd', s) s = re.sub('[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f]', '\ufffd', s)
return io.StringIO(s) return io.StringIO(s)