1# -*- coding: utf-8 -*- 2import os 3import io 4from music21 import common 5 6if __name__ == '__main__': 7 directory = common.getSourceFilePath() 8 9 for root, dirs, files in os.walk(directory): 10 for f in files: 11 if f.endswith('.py') is not True: 12 continue 13 fullf = root + os.sep + f 14 if 'ext' in root: 15 continue 16 with io.open(fullf, encoding='latin-1') as fh: 17 data = fh.read() 18 head = data[0:200] 19 if 'utf-8' not in head: 20 print(fullf, ' is not utf-8 compliant') 21