If you get the above when trying to do an aws s3 sync then check your LANG settings… for some reason inside a docker container I had no LANG=en_AU.UTF-8 set and so the aws cli could not encode the romantic little love hearts and weird characters that people embed in photo filenames these days.

So my solutions was to create the correct LANG environment vars as follows

Install locales

apt-get install locales

locale-gen en_AU.UTF-8

export LANG=en_AU.UTF-8
export LC_ALL=en_AU.UTF-8
export LANGUAGE=en_AU.UTF-8

and then:

aws s3 sync Blah s3://bucketname/Path/Blah

I found that setting the LANG vars in /etc/default/locale or /etc/environment and restarting the container did bubkiss (didn’t work).