S
S
StrangeAttractor2014-08-22 15:53:10
Unicode
StrangeAttractor, 2014-08-22 15:53:10

How to configure encoding in Samba under Cygwin?

Beware, pervert. Microsoft fans don't read to avoid "pattern breaking" :-)
I'm trying to get Sambo's smbclient (3.0.7) to work on Windows 7 (downloaded here ).
The first problem I encountered was that I can't find the config in /etc/where I can't remember. So far, I decided to install a full-fledged cygwin and launch it through its terminal (respectively, having created a config file in the appropriate place), although they say you can do without it.
The second problem, the solution of which, in fact, is being sought is the issue of encodings. If it does not write anything about encodings in the config, then instead of Russian letters in the file names on the balls, respectively, porridge.
And if you write at least something instead of listing files, lines like

init_iconv: Conversion from UCS-2LE to cp866 not supported
init_iconv: Attempting to replace with conversion from UCS-2LE to ASCII
init_iconv: Conversion from UTF8 to cp866 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from ASCII to cp866 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp866 to UCS-2LE not supported
init_iconv: Attempting to replace with conversion from ASCII to UCS-2LE
init_iconv: Conversion from cp866 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp866 to ASCII not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from cp866 to UTF8 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII
init_iconv: Conversion from UTF8 to cp866 not supported
init_iconv: Attempting to replace with conversion from ASCII to ASCII

And no matter how I change the encodings in the config (different combinations of variations on the topic UTF8, utf-8, cp866, cp1251, cp1250, ASCII, ISO-8859-5, etc.), the result is only abuse like the above.
If there are no errors at all, but the file names are clumsy, and if you feed them to Lebedev 's decoder, it successfully decrypts them (although it loses the first letter) and writes "7-bit ASCII → ISO-8859-5". locale charmap outputs UTF-8 in console. Windows is English, CP1250 is selected as the ANSI encoding for programs that do not support Unicode. The server is Linux with Samba 3.6.6, on normal Windows clients, respectively, everything is fine.
Another interesting nuance is that we have files on Samba-shares not only with English and Russian letters in their names, but also with Central European ones (ž, š, etc., the so-called Latin2, in eight-bit encodings this is DOS / ASCII CP852, Windows/ANSI CP1250, ISO 8859-2) i.e. it is impossible to unequivocally select one DOS/Windows/ISO encoding.
The web is full of questions about "init_iconv: Conversion from ... to ... not supported" in the context of Samba, but no real solution has been found.
The question is, respectively, what to write in smb.conf in dos charset, unix charset, display charset, etc. (or somewhere else) to fix it.
UPDATE: I found settings that do not give errors, but the texts are still crooked (although in a different way): unix charset = UTF8, display charset = UCS-2LE.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
StrangeAttractor, 2014-08-22
@StrangeAttractor

By sorting through various combinations of options, the answer was found: this smb.conf worked for me:

[global]
workgroup = WORKGROUP
unix charset = UTF8
dos charset = UCS-2LE
display charset = UTF8

The format for writing paths in this case is the standard windrow type \\server\share, only the number of backslashes is multiplied by two: \\\\server\\share

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question