mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-23 01:56:36 +03:00
21 lines
498 B
Python
21 lines
498 B
Python
import sys, glob
|
|
sys.path.insert(0, '..')
|
|
from chardet.universaldetector import UniversalDetector
|
|
|
|
count = 0
|
|
u = UniversalDetector()
|
|
for f in glob.glob(sys.argv[1]):
|
|
print f.ljust(60),
|
|
u.reset()
|
|
for line in file(f, 'rb'):
|
|
u.feed(line)
|
|
if u.done: break
|
|
u.close()
|
|
result = u.result
|
|
if result['encoding']:
|
|
print result['encoding'], 'with confidence', result['confidence']
|
|
else:
|
|
print '******** no result'
|
|
count += 1
|
|
print count, 'tests'
|