add utf-8 file encoding detector in python code.