character set for Windows?
Michal Soltys
soltys at ziu.info
Mon Dec 1 19:20:57 GMT 2008
Steve Lefevre wrote:
> I'm using cygwin to backup files from a windows machine to a unix host
> with rsync. I originally uploaded the bulk of the files using a
> windows ftp client, and then planned on doing updates nightly with
> rsync.
This can also be important, especially regarding how the ftp server is
configured - as it might have converted some of the filenames itself to
the locale used on your unix - for example extended vsftpd builds have
full iconv functionality themselves.
From win32's side, and if you don't use utf8 "modified" cygwin1.dll (
http://www.okisoft.co.jp/esc/utf8-cygwin/ ), filenames will be converted
according to the "reginal and language options" -> "advanced" setting
whenever non-unicode win32 api is used, as far as I know - so that would
include standard cygwin and cli ftp client on windows.
Modified cygwin1.dll certainly simplifies life (I've been using it for
quite a while), as everything coming from win32 will be in utf8, and
coming to win32 should be in utf8. Dll will take the care of the
conversion to native unicode used on win32, and legacy regional options
will be irrelevant then.
>
> I was looking for what switch to use to tell rsync to use a windows
> character set, and it seems like I need to use is --iconv, but i'm
> unsure what character set windows uses ( this is xp ), or in other
> words, what the argument should be.
>
If you decide to use mentioned cygwin1.dll , and your linux operates in
utf8 by default, you shouldn't need anything else. If you use some
legacy locale on unix - --iconv=.,utf8 should do the thing - assuming
win32 is remote machine, and locale is set properly on unix machine.
Otherwise, it's up to you and --iconv / --no-iconv . The latter should
work perfectly fine as well (ignoring filename adjustments completely -
unix shouldn't have any problems with storing any filenames), although
locale-aware programs (ls, etc.) might display them with a bit of
weirdness. Even simple tab-completion (under e.g. bash) will depend on
locale and inputrc settings as well.
More information about the rsync
mailing list