Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[renamerOnUpdate][Feature] Remove Non Ascii/Emojis #452

Open
C-BoT-AU opened this issue Oct 12, 2024 · 0 comments
Open

[renamerOnUpdate][Feature] Remove Non Ascii/Emojis #452

C-BoT-AU opened this issue Oct 12, 2024 · 0 comments

Comments

@C-BoT-AU
Copy link

I have been having some issues with emoji's and similar characters in filenames on my system. I usually search these out using a regex search for [^\x20-\x7E\n\t\r] so wanted to include that in the renamerOnUpdate script to remove.
Unfortunately, after numerous ways of trying to add it to the removecharac_Filename variable, I gave up and inserted it into the main renamerOnUpdate.py at line 942:

    # Remove illegal character for Windows
    new_filename = re.sub('[\\/:"*?<>|]+', "", new_filename)
    new_filename = re.sub(r"[^\x20-\x7E\n\t\r]+", "", new_filename) # Remove non Ascii characters

There may be a cleaner/better way to do this, or to include it in the removecharac_Filename variable, but for now this was the simplest way I could think of.
It could be standardised by adding a removeNonAscii TRUE/FALSE variable to the config that then embeds this rename in another if statement.

I'm unsure if the if MODULE_UNIDECODE and UNICODE_USE: at line 947 is meant to do this or something else. The warnings made me not try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant