Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When serving files containing special characters such as "()?:" in the filename through Samba, the names get transformed into an unrecognizable format. For example, a file


is displayed as


Is there a way to avoid this behavior (without renaming the files, obviously)? I'm assuming that character encoding is not to blame because several UTF-8 characters seem to work fine.

share|improve this question
Samba version 2:3.4.0-3ubuntu5.5 on Ubuntu 9.10 – Matti Mar 20 '10 at 22:55
Adding "mangled names = no" to smb.conf solved this (thanks, Dennis Williamson). – Matti Mar 23 '10 at 0:25

Windows does not allow some characters in filenames that Unix does allow. Samba "mangles" the filenames to make them comply with Windows restrictions. You can check the file /etc/smb.conf or /etc/samba/smb.conf to see what settings are in place. To show those settings plus the defaults, use this command:

testparm -vs | less

To narrow that down a bit:

testparm -vs|grep "case\|mangl"

See this page for more information. Also, see about half way down this page (the same information as the previous link).

share|improve this answer

from samba documentation you can use these:

dos charset = ISO8859-1
unix charset = ISO8859-1
display charset = ISO8859-1
share|improve this answer
This and adding mangled names= no to [global] fixed my on nas4free – Christopher Chase Jun 6 '15 at 0:51

I use a shared folder on OS-X and Windows. Some files have the same issue, because they fall into the following: They use characters in the file-name, not supported by Windows.


It lists the characters, not supported by Windows in files or directories. I guess, that Samba uses the same list of characters when listing files and directories.

A filename cannot contain any of the following characters:
\ / : * ? " < > |

A bit further down, they wrote:

Characters that are valid for naming files, folders, or shortcuts include any combination of letters (A-Z) and numbers (0-9), plus the following special characters:

^   Accent circumflex (caret)
&   Ampersand
'   Apostrophe (single quotation mark)
@   At sign
{   Brace left
}   Brace right
[   Bracket opening
]   Bracket closing
,   Comma
$   Dollar sign
=   Equal sign
!   Exclamation point
-   Hyphen
#   Number sign
(   Parenthesis opening
)   Parenthesis closing
%   Percent
.   Period
+   Plus
~   Tilde
_   Underscore

But I, personally, took the listing of not-allowed characters as a reference for briefing some customers here ;)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.