seems Chinese char is cleaned by this function.
def clean_filename(filename: str) -> str:
"""Replaces invalid chars in filenames with '_'"""
result = filename.encode(
"utf-8").decode("ascii", "ignore")
invalid = '<>:"/\\|?*\0'
for char in invalid:
result = result.replace(char, '_')
return result
the output "假期_01.jpg" is "_01.jpg" without Chinese char
In [1]: clean_filename("假期_01.jpg")
Out[1]: _01.jpg
seems Chinese char is cleaned by this function.
the output "假期_01.jpg" is "_01.jpg" without Chinese char