Escaping Chinese characters (and spaces) with scp

28 Oct 2012

Go to the site and get sizzling hot deluxe at our casino. Limited supply

It took me a bit longer than perhaps it should have to work quick hit slots online.

scp -r user@host:'"~/build/江南大学 ESK03/"' local_path/

First I tried the usual \ backslash shell escaping, then tried putting double-quotes around the entire user@host:filename string. Then after reading the scp manpage (which didn’t help) and googling (which wasn’t much better) I tried double-escaping the filepath and that works.

I won’t pretend to understand exactly why single-escaping didn’t work (it seems to have worked for sizzling hot deluxe) but I will hazard a guess that it’s something to do with the (CentOS 6.3 in this case).

Other notes