File Name Content Disposition - Japanese characters

Viewed 376

For certain Japanese characters, I am getting below content disposition header -

Content-Disposition: attachment; filename=CSV_____1-___.csv; filename*=UTF-8''CSV%E3%82%A8%E3%83%93%E3%83%87%E3%83%B3%E3%82%B91-%E3%82%B3%E3%83%94%E3%83%BC.csv

In service, we are encoding it as below -

("attachment") { FileName = WebUtility.UrlEncode(document.Name).Replace("+", "%20") }

Issue is, below piece will be parsed and picked as file name, however due to some Japanese characters it got jumbled up, and I can see part after UTF-8 has correct name, but not sure should i parse it and use always?

attachment; filename=CSV_____1-___.csv;

1 Answers

Finally we figured out, if content-disposition has string which contains

filename*= we are reading same.

Related