rsync on Windows + non-ASCII file names

13,181

Solution 1

rsync offers an --iconv option for filename character encoding conversion. It accepts arguments for fine-grained control over source and target encoding.

From the rsync man page:

[...] you can fully specify what conversion to do by giving a 
local and a remote charset separated by a comma in the 
order --iconv=LOCAL,REMOTE, e.g.  --iconv=utf8,iso88591.

Solution 2

If you tried to use DeltaCopy, then get UTF-8 capable cygwin (=cygwin1.dll) from http://www.oki-osk.jp/esc/utf8-cygwin/ The solution has been a must for the japans and they have had it at least since 2006.

Unpack the dll binary by using 7zip twice. Then remove original cygwin1.dll from your DeltaCopy program folder and put the new one instead. Beware: Old and new have exactly equal appearances. Keep it clear which one is the new. After changing the dll in client and server, the transmission works ok between two Windows machines. Sadly the client console displays gibberish when it tries to show some filename having multibyte UTF-8 chars, but the transmissin works.

I've not tried what happens if the backup server has Linux or some else UNIX-resemblant (for example Nas4Free) and only the client in Windows machine is fixed.

Obviously rsync handles UTF-8 but cygwin doesn't. In DeltaCopy's cygwin the UTF-8 filenames are at first misspelled and when a copy of a file is tried to create, the file seems to be vanished.

Share:
13,181
9000
Author by

9000

I constantly try to expand the little I know about programming.

Updated on September 18, 2022

Comments

  • 9000
    9000 over 1 year

    Is there a version of rsync that runs on current Windows versions and can handle non-ASCII file names? Every version I checked (including cwRsync and rsync.net client) fail miserably on files with Unicode characters in names.

    If such version of rsync does not exist, what other tool might I use for bandwidth-efficient synchronization of files between Windows and Linux?

    I'm synchronizing large, rarely changing file trees over a relatively slow link. The difference between the rsync-style synchronization and full-copy approaches is significant.

    • gogators
      gogators about 11 years
      Haven't tested it, but what about installing cygwin and using their rsync?
    • 9000
      9000 about 11 years
      @KevinVW: have tested it, the cygwin's rsync version does exhibit the bug I'm complaining about.
    • wnrph
      wnrph about 11 years
      have you already tried using the --iconv option?
    • 9000
      9000 about 11 years
      @artistoex: yes, --iconv indeed solves the problem. Please make your comment into an answer so that I could accept it :)
  • IlPADlI
    IlPADlI over 8 years
    I am using rsync daemon in linux as server to backup my files. Client cwRsync in windows for send files. I encount filename encoding problem too. When i added --iconv=gbk,utf8 in command line args, got below error. How can i to slove it? sending incremental file list rsync: writefd_unbuffered failed to write 4 bytes [sender]: Connection reset by peer (104) rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/io.c(791) [sender=3.0.4]
  • wnrph
    wnrph about 8 years
    You should post that as a separate question
  • wnrph
    wnrph about 8 years
    But your problem looks like what is described here: askubuntu.com/questions/249853/…
  • Hernán Eche
    Hernán Eche over 5 years
    broken link 404
  • korylprince
    korylprince over 3 years