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

Trim space and period in Windows #25

Closed
eggplants opened this issue Aug 14, 2022 · 1 comment · Fixed by #28
Closed

Trim space and period in Windows #25

eggplants opened this issue Aug 14, 2022 · 1 comment · Fixed by #28

Comments

@eggplants
Copy link
Contributor

I would like to trim heading and trailing Space 0x20 && trailing Period 0x2E with sanitize_filename if given platform is Windows.


https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/file-folder-name-whitespace-characters

File and Folder names that begin or end with the ASCII Space (0x20) will be saved without these characters. File and Folder names that end with the ASCII Period (0x2E) character will also be saved without this character. All other trailing or leading whitespace characters are retained.

@thombashi
Copy link
Owner

@eggplants
sanitize_filename does already trim those characters when the platform is windows:

["windows", "space ", "space"],
["windows", "space_and_period .", "space_and_period"],
["windows", "space_and_period. ", "space_and_period"],

Did you mean these trim were not working correctly?

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

Successfully merging a pull request may close this issue.

2 participants