-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The AmazonS3Uri class does not seem to support some characters #3585
Comments
Hello @mhroberts7734, Thank you for reporting the issue. var filename = "https://my-bucket.s3.us-east-1.amazonaws.com/180天OTB+(锦江)1216+-+sample+(1).xlsx";
var url = new Uri(filename);
var s3Url = new AmazonS3Uri(url);
var key = s3Url.Key;
Console.WriteLine(key);
var s3Key = Uri.UnescapeDataString(url.AbsolutePath); Above steps, reproduces key as I am running this on a windows console application with Regardless, the expected behavior should be that the There seems to be a similar issue reported in past - #1902. Meanwhile, as you provide the environment and encoding details, I will review this with the team. Regards, |
Hello, I am not using the console to view the output of the two, I was using the debugger and just hovering over the variables. That makes sense that the console would replace the unicode sequences with those glyphs though. This example just isolates an issue that we are having in our production system, where we are trying to parse an s3 presigned url to build an s3 request. We're getting the key and bucket name from this url, and it results in the s3 client not finding the object in the bucket, even though it is there; the key is just corrupted. |
Hello @mhroberts7734, Yes, I acknowledge that whether the corrupted S3 key appears as Unicode escape sequences in the debugger or as garbled characters in the console, they are both manifestations of the same root cause: the I have verified that this specific scenario has already been documented in our issue tracking system. However, at this time, I cannot provide a specific timeline for when this issue will get prioritized. Regards, |
Describe the bug
When using the AmazonS3Uri class to parse pre-signed urls to get the key and bucket name, The class gets some characters incorrect.
Regression Issue
Expected Behavior
key = "180天OTB+(锦江)1216+-+sample+(1).xlsx"
Current Behavior
key = "180天OTB+(é\u0094¦æ±\u009fï¼\u00891216+-+sample+(1).xlsx"
Reproduction Steps
var filename = "https://my-bucket.s3.us-east-1.amazonaws.com/180天OTB+(锦江)1216+-+sample+(1).xlsx";
var url = new Uri(filename);
var s3Url = new AmazonS3Uri(url);
var key = s3Url.Key;
var s3Key = Uri.UnescapeDataString(url.AbsolutePath);
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
AWSSDK.S3 3.7.410.8
Targeted .NET Platform
.NET 8.0
Operating System and version
Windows 11
The text was updated successfully, but these errors were encountered: