Skip to content

Windows media shares and filename encoding

Microsoft’s built-in Client for NFS writes filenames using the system ANSI codepage (CP1252 on Western-European installs), rather than UTF-8. NFS stores the bytes unchanged, so Windows-written names can contain invalid UTF-8 even when the media itself plays correctly.

CharacterUTF-8 (correct)CP1252 (what Windows writes)
äc3 a4e4
öc3 b6f6
üc3 bcfc
ßc3 9fdf

In a mixed library, Linux-written names remain correct while Windows-written names reach the scanner with replacement characters. Those names affect title matching and the labels on unmatched items.

  1. Write over SMB (recommended). Export the directory with Samba and point Windows tooling at it. SMB handles Unicode natively; Linux/container readers can keep their NFS mounts.
  2. Replace the NFS client. ms-nfs41-client supports NFSv4.2 and UTF-8, including characters above the BMP. It requires Cygwin and an unsigned kernel driver (Secure Boot off). Its documented nfsd.exe crashes require a reboot; benchmark throughput against SMB. For a machine-wide mount restored at boot, use /etc/fstab.msnfs41client. The nfs_globalmount -p option persists a per-user connection that doesn’t restore on a headless server.
  3. Switch Windows to a UTF-8 codepage. In Region → Administrative → Change system locale, enable Beta: Use Unicode UTF-8 for worldwide language support, then reboot. This sets the ANSI codepage to 65001. It can break older non-Unicode applications; check your download client afterward.

None of the above is retroactive. Fix existing filenames on the NFS server with convmv:

Terminal window
# Dry run — convmv only prints what it would do unless you pass --notest
convmv -r -f cp1252 -t utf8 /path/to/library
# Apply, once the proposed renames look right
convmv -r -f cp1252 -t utf8 --notest /path/to/library

Renaming changes the path, so run a scan afterwards to pick the files up under their corrected names.

See Performance tuning for scan concurrency and NFS mount settings.