-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUTF8Checker.py
More file actions
30 lines (25 loc) · 1.05 KB
/
UTF8Checker.py
File metadata and controls
30 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import re
cwd = os.getcwd() # Get the current working directory (cwd)
files = os.listdir(cwd) # Get all the files in that directory
import csv
for element in files:
with open(element)as file:
csvFile = csv.reader(file)
for lines in csvFile:
s1 = "á"
s2 = "é"
s3 = "Ã\xad"
s4 = "ó"
s5 = "ú"
if lines.count(s1):
print("Character " +s1 + " equals to á found in file" + element)
elif lines.count(s2):
print("Character " +s2 + " equals to é found in file" + element)
elif lines.count(s3):
print("Character " +s3 + "equals to í found in file" + element)
elif lines.count(s4):
print("Character " +s4 + " equals to ó found in file" + element)
elif lines.count(s4):
print("Character " +s4 + "equals to ú found in file" + element)
print("file "+element+" completed")