Mount unix samba 4 share to osx client without mangled file names

I have a unix server (arch linux) with samba 4.1.12. The share has files inside it with utf-8 nfc encoding (standard utf-8).

When I mount this samba share into an osx client (10.9.5), files with special names like File with "quotes" are displayed mangled (C7XSWH~V) on the osx client.

When I create a file with special chars on the osx client inside the share, it displays correctly in osx but on the unix server it is display with a weird symbol like File with quotes.

I think it is because osx expects the filenames to be in utf-8 nfd form, but the files are server as utf-8 nfc.

Basically I want to have a working samba share where users from osx and unix clients can access and store files, and special chars in file names should be allowed. Is there any way to do this cross platform?

How can I tell osx to simply use utf-8 nfc encoding for the samba share? Is there a way to do it?

I already tried things like explicitly setting the encoding in smb.conf on the unix server, with no luck:

unix charset = utf-8
dos charset = utf-8

# --> error in log:
# invalid DOS charset: 'dos charset' must not be UTF8, using (default value) CP850 instead

# or

dos charset = utf-8-mac

# --> error in log:
# dos charset 'utf-8-mac' unavailable - using ASCII

Solution 1:

This is/was a missing feature in the samba client. In samba 4.2 there is the vfs_fruit module to overcome this restrictions - see the mailing list thread https://lists.samba.org/archive/samba/2014-December/187545.html for more details.

With the vfs_fruit module you can do:

vfs objects = catia fruit streams_xattr
fruit:encoding = native

And samba transparently maps the filenames for osx clients (even it still has some problems if files end with a space for example).