Files with accents not showing from an SMB share on macOS

I recently had an issue where some files with accents were showing, but not all of them. If none of them were showing, I might have assumed an encoding issue, but it’s clear something else was at play here. This was pretty annoying when I wanted to play a specific song.

As it turns out, on macOS, it’s almost certainly a Unicode normalization issue, where Apple is (unnecessarily) strict about Unicode. I seem to keep running into these issues on macOS – I first into it trying to notarize a zip file. Luckily, there’s a tool that can handle this for you.

You’ll want to install the convmv tool from your favourite package manager. (I’m doing this from my NAS running FreeBSD.) Before I did anything, I made a ZFS snapshot just in case it messed up; I had no issues myself and could delete the snapshot afterwards.

Run the tool to conversion between UTF-8 and UTF-8. Normally this is a no-op, but we’re giving it the flag to normalize normalization, so it’ll actually do something useful. The first time you run it, it’ll be a dry run:

$ convmv -r -f UTF-8 -t UTF-8 --nfc  /srv/music
Starting a dry run without changes...
mv "/srv/music/Swans/Die Tür Ist Zu (1996)"	"/srv/music/Swans/Die Tür Ist Zu (1996)"
mv "/srv/music/Grimes/Art Angels (2015)/12 - Venus Fly (feat. Janelle Monáe).mp3"	"/srv/music/Grimes/Art Angels (2015)/12 - Venus Fly (feat. Janelle Monáe).mp3"
No changes to your files done. Would have converted 2 files in 4 seconds.
Use --notest to finally rename the files.

If this looks reasonable, run it again, with the flag to make it actually do something:

$ convmv -r -f UTF-8 -t UTF-8 --nfc --notest /srv/music
mv "/srv/music/Swans/Die Tür Ist Zu (1996)"	"/srv/music/Swans/Die Tür Ist Zu (1996)"
mv "/srv/music/Grimes/Art Angels (2015)/12 - Venus Fly (feat. Janelle Monáe).mp3"	"/srv/music/Grimes/Art Angels (2015)/12 - Venus Fly (feat. Janelle Monáe).mp3"
Ready! I converted 2 files in 4 seconds.

I had to unmount and then mount the share again to see the files.

Leave a Reply

Your email address will not be published.