I want to download a file with Japanese filename without change the originality. Here is the code which I am using for download a file:
Response.ContentType = "application/octet-stream";
var contentDisposition = "attachment; filename*=UTF-8''" + Uri.EscapeDataString("filename");
Response.Headers["Content-Disposition"] = contentDisposition;
return await _s3.DownloadFileAsStream(S3Storage.FilesBucket, filename);
This will return the file with filenames:
High Siera.pdf --> High Siera.pdf (Correct)
2018年 国内カレンダー年 --> 2018年%E3%80%80国内カレンダー年 (Wrong)
Japanese filename getting escaped and replaced.