Repository navigation
Description
Hello.
Please developers, for some users would be really useful to be capable to select which normalization wants that Syncthing do. Now Syncthing enforces a NFD normalization when installed in macOS, and a NFC normalization in all other systems. This is correct, but I think that it don't cover all 100% user cases. There are cases where let the user choose which normalization wants is better. Let me explain one of these cases:
- Syncthing installed in a FreeBSD computer. Under zfs (with normalization=formD option, we will see after why).
- The Syncthing's shared directory is with a Windows PC
- BUT this same Syncthing's shared directory is shared via NFS from the FreeBSD to a macOS client (and this is the reason to use the normalization=formD option in zfs, as recommended in https://openzfsonosx.org/wiki/Zpool )
What happens in this situation with the Syncthing's shared directory is:
- The macOS machine creates files with the Finder, for example, a directory named "árbol" (with NFD normalization, because it's created in macOS)
- FreeBSD writes it, via NFS, to the zfs (with NFD normalization). zfs normalization is when reading, not when writing
- Syncthing, because it's running in a FreeBSD machine, asumes NFC normalization and normalice it to NFC. The another Syncthing machine, Windows, is happy. But the macOS machine is not so happy, the Finder has really problems to read this directory....
The solution I propose is one setting to let the user choose which normalization wants that Syncthing do. This way I would choose a NFD normalization in the FreeBSD machine, and the NFS machine (macOS) would be happy, and the other Syncthing machine (Windows) would be happy, and I would be also happy : )
By the way, disabling the "Auto Normalize" option in the FreeBSD machine has undesirable effects under this situation:
- Files created with the macOS machine in the NFS share begins to give errors like this in the FreeBSD machine:
2018-11-26 21:37:51: File name "árbol" is not in the correct UTF8 normalization form; skipping.
Version Information
Syncthing Version: v0.14.51
OS Version: FreeBSD (64 bit)
Activity
[-]Make which normalization type to use user selectable[/-][+]Make which normalization type to do user selectable[/+]calmh commentedon Nov 26, 2018
This seems super duper niche and honestly I don't think it's something we want to dive into... I get that it's a pain sharing files between systems (which is why Syncthing does what it does) but honestly I think the appropriate solution is to use NFC on FreeBSD and share it to MacOS using Samba which correctly handles the conversion (this is what I do, fwiw). (Maybe there are similar options for the nfsd, I don't know.)
It's not that your case is invalid, there are also good reasons for using ISO-8859-1 or Big5 or other character sets, and Apple choosing NFD is arguably bizarre. But we don't want to try to support all possible variants.
vicmarto commentedon Nov 26, 2018
Yes, I know this is not very common, but... I would not say niche. NFS is still used in business environments, given the problems with the current SMB implementation in macOS: https://www.google.com/search?rls=en&q=smb+issue+macos&ie=UTF-8&oe=UTF-8
The real value of Syncthing is make easy to share files between systems, but all goes complicated when a macOS machine is involved. This is why I'm asking for this. Only an option to chose the normalization, all the under the hood work is already done, and is perfect. Please developers, make it reality!
P/S: Yes, I agree with you: Apple choosing NFD is bizarre, really. But, we have to deal with that, unfortunately.
calmh commentedon Nov 26, 2018
Well, it's niche from the point of view that you're the first of probably millions of users to mention it, and running into the issue requires using the cross product of two single-digit-percentage operating systems and a deprecated (-ish) file sharing protocol -
s/smb/nfs/in your url and you also get millions of results. ;)Syncthing on macOS isn't complicated. Dealing with macOS file name encodings on non-MacOS might be.
So anyway. Normalization happens deep in the system, in multiple places, and stretches all the way into how things are keyed in the database. As it is, in my determination, it would be too complex and difficult to test to make this generally configurable. Sorry.
vicmarto commentedon Nov 26, 2018
I see now, the complexity to implement it would be much more difficult that I though.
Well, thank you very much anyway.