Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

my_file:_(important).txt

is displayed as

M43J1E~0.TXT

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

3 Answers 3

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

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.

See: http://support.microsoft.com/kb/177506

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

 
discard

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.