add unit test for #8325
use S3Client::encodeKey(), fixes #8325