The code is straightforward. When I save it with a simple, us-ascii file name like this:
Aspose.Words.Document doc = new Aspose.Words.Document(stream);
doc.JoinRunsWithSameFormatting();
doc.SaveOptions.HtmlExportCssStyleSheetType =
Aspose.Words.CssStyleSheetType.Embedded;
doc.SaveOptions.ExportPrettyFormat = true;
doc.Save(
"test.mht",
Aspose.Words.SaveFormat.Mhtml,
Aspose.Words.SaveType.OpenInBrowser,
Response);
this is the HTTP response sent over the wire:
HTTP/1.1 200 OK
[uninteresting headers deleted]
content-disposition: inline; filename=test.mht
Now, if I save it using e.g. a norwegian file name “Hær.mht” (after the H is the a and e glued together), this is the file name sent over the wire:
content-disposition: inline; filename=H…r.mht
This is obviously not correct.
The remedy is in the Save() procedure not to just put the file name to a content-disposition header, but encode it. The encoding routines are present in the Microsoft class mentioned in the orignal post.
Cheers,
Alex