dharple / detox

Tames problematic filenames
BSD 3-Clause "New" or "Revised" License
332 stars 19 forks source link

Detox not replacing 0x202F (narrow no-break space) on MacOS #116

Open germyparker opened 6 months ago

germyparker commented 6 months ago

As the title says, the 202F character (NNBSP) isn't being replaced with _ in MacOS. I've confirmed the character is in detox -- line 213 of unicode.tbl. When I take the exact same (problematic) file, rsync it to my Linux computer, confirm the character hasn't been altered (via vim -> ga), then detox it, the bad character is successfully replaced. But not in MacOS???

Some details, because who doesn't love details:

When you take a screenshot or screen recording using the default MacOS tool (Command + Shift + 3 or 5), the file is saved with the following filename:

Screen Recording 2024-04-24 at 12.22.20 PM.mov

Most of those "spaces" are in fact normal spaces, but that last one -- between the time and PM -- is the NNBSP. (Why do they do that? Because Apple. Why do we use Linux whenever possible? See previous response.)

╰─ echo "Screen Recording 2024-04-24 at 12.22.20 PM" | detox --inline
Screen_Recording_2024-04-24_at_12.22.20 PM

After doing some research, I can provide these additional -- tho not necessarily helpful -- details:

If it helps, I'd be happy to perform any tests you might need, in case you don't have a MacOS computer around. I can probably test on a non-ARM MacOS computer if you'd like, I just need to steal my old computer back from my wife.