Skip to content

Commit

Permalink
Create detect_filenames.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sakgoyal authored Mar 7, 2023
1 parent a60875c commit 6f41550
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions detect_filenames.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import sys
import glob

if len(sys.argv) > 1:
directories = sys.argv[1:]
else:
directories = input("Enter directory paths separated by spaces: ").split(" ")

#Unicode RTLO Characters
blacklist = set(['\u200E', '\u200F', '\u202A', '\u202B', '\u202C', '\u202D', '\u202E', '\u2066', '\u2067', '\u2068', '\u2069', ])

for directory in directories:
for filepath in glob.glob(f'{directory}/**/*', recursive=True):
if any(char in blacklist for char in filepath):
print(f"File '{filepath}' contains Unicode characters")

0 comments on commit 6f41550

Please sign in to comment.