Re:APFS does not normalize Unicode filenames
by therealmarv on Monday March 27, 2017 @12:49PM
(#13969343)
Well one of this (the Apple one) is clearly wrong because Samba (which is not a niche software) does not work with it and this is critical for me. Just saying I'm not the only one who is confused ;)
Re:APFS does not normalize Unicode filenames
by eridius on Monday March 27, 2017 @02:12PM
(#13970218)
It's not wrong. There are multiple ways to represent a lot of filenames (in particular, names with accents, umlauts, or graves). It's very plausible that the input methods on different systems are producing different sequences (composed vs decomposed). If you're storing a file with a composed sequence on your server, then copy it to your Mac's drive, then copy it back, you may end up with a duplicate file because it would have ended up as a decomposed sequence on your local drive.
But this doesn't make it wrong. You can reproduce this exact behavior with other systems too simply by changing the local filename to be decomposed. The only Mac-specific part here is that HFS+ will automatically decompose the filename.
On HFS+, because it normalizes, if you try to pass either form to the filesystem, it will treat them the same. But on filesystems that don't normalize (which is most of them) they'll be treated as distinct files. As a result, depending on the input you provide and whether the tools in question do any normalization, you could end up with two files that look identical (e.g. your two "hällö" files) but are different unicode sequences under the hood.
And none of this really has anything to do with UTF-8. UTF-8 is just a byte encoding scheme that can represent all valid unicode sequences.