`Proxy::Util.escape_for_shell` should get used here. It's a 1.8 + 1.9 compatible version of the escape methods that are available in 1.9.