reformatting
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
This commit is contained in:
@@ -245,10 +245,26 @@ class FileNameFormatter:
|
||||
if ord(char) < 0x80:
|
||||
result.append(char)
|
||||
# Keep common Unicode letters, numbers, and punctuation
|
||||
elif unicodedata.category(char) in ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nd', 'Nl', 'No', 'Pc', 'Pd', 'Ps', 'Pe', 'Pi', 'Pf', 'Po']:
|
||||
elif unicodedata.category(char) in [
|
||||
"Lu",
|
||||
"Ll",
|
||||
"Lt",
|
||||
"Lm",
|
||||
"Lo",
|
||||
"Nd",
|
||||
"Nl",
|
||||
"No",
|
||||
"Pc",
|
||||
"Pd",
|
||||
"Ps",
|
||||
"Pe",
|
||||
"Pi",
|
||||
"Pf",
|
||||
"Po",
|
||||
]:
|
||||
result.append(char)
|
||||
# Strip emoji, symbols, and other special characters that cause 8.3 names
|
||||
elif unicodedata.category(char).startswith(('S', 'So', 'Sk', 'Sm')): # Symbols
|
||||
elif unicodedata.category(char).startswith(("S", "So", "Sk", "Sm")): # Symbols
|
||||
continue
|
||||
elif ord(char) > 0x1F000: # High Unicode ranges often contain emoji
|
||||
continue
|
||||
@@ -256,7 +272,7 @@ class FileNameFormatter:
|
||||
# Keep other Unicode characters that are generally safe
|
||||
result.append(char)
|
||||
|
||||
return ''.join(result)
|
||||
return "".join(result)
|
||||
|
||||
@staticmethod
|
||||
def _strip_emojis(input_string: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user