sindresorhus / filenamify

Convert a string to a valid safe filename
MIT License
489 stars 26 forks source link

Make decomposing characters optional. #35

Open issuefiler opened 2 years ago

issuefiler commented 2 years ago

I think this (.normalize("NFD")) should be optional.

Decomposing — yes, it’s for MacOS that decompose filename characters, but it comes with the obvious drawback: characters take more bytes than necessary. Hangul characters for example, get doubled or tripled in size, which means a filename can only have up to forty Hangul characters on average by your default maximum filename length MAX_FILENAME_LENGTH (100).