Linux – Rsync Character set problems

character encodinglinuxrsync

I'm attempting to backup a windows box to a Linux box (Ubuntu 9.10) using rsync on the Linux box, and I get "file has vanished" errors for filenames with unusual characters in the filenames. I get a similar error ("no such file or directory") if I use "cp" instead of rsync. The source in a share on an English language Windows box.

One of the characters is the apostrophe character.

I've been playing around with various –iconv options but haven't been able to solve the problem. Suggestions?

Best Answer

You're mounting the share from Windows on Linux, then using rsync to copy files locally. How do you mount the share?

Windows should be storing filenames in UTF8 or UTF16, but you need to tell Linux that so it can mount the share correctly. Use a mount option like utf8/utf16, or iocharset=utf8/iocharset=utf16 in your mount command:

mount -t cifs -o utf16,other,options,here //server/share /path/to/mount/point
              ^^^^^^^^
                   |
                   -- if utf16 doesn't help, try iocharset=utf16
                      utf8 or iocharset=utf8 may also work

Other users are indicating that UTF16 is more likely to be correct.

Related Question