'Why am I getting a SignatureDoesNotMatch error when object key contains grave accent marks?

I have been trying to replicate backup files on S3 bucket and one of my machines, which belongs to french culture, and the images it generated contains grave-accent marks in the file names for eg: Backup/Récupération12_VOL-b003.sp1.

I have been struggling really hard to upload it via C# code and when I am trying to hit an API to list multipart uploads. I get a 403 error with this message.

Code: SignatureDoesNotMatch Message: The request signature we
calculated does not match the signature you provided. Check your key
and signing method.

However, if I am trying to upload such files directly from a AWS S3 console, it get's uploaded without any problem.

I have tried passing encoding type (UTF-8) as well with the GET request but still the issue seems unsolvable.

I will really appreciate your help on this.

Please find the below GET request for your reference.

CanonicalRequest: GET/
encoding-type=UTF-8&prefix=Backup%2FR%C3%A9cup%C3%A9ration12_VOL-b003sp1&uploads=host:testbuckettoday12052022.s3.ap-south-1.amazonaws.com
x-amz-checksum-algorithm:SHA256
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date:20220512T073347Z


Solution 1:[1]

I found no problem. Here's the example code I used to test the upload to S3 for the same filename with grave accent marks.

https://www.example-code.com/csharp/s3_upload_with_accented_chars_in_filename.asp

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chilkat Software