0

I want to input Unicode string in String.Format() method.

This is my code:

string filename = String.Format("Това трябва да е уникод {0}_{1}.doc", wayBillNum, DateTime.Now.ToShortDateString());

//File name for the exported word document
HttpContext.Current.Response.AddHeader("Content-Disposition", "inline;filename=" + filename);

How to do this?

Filburt
  • 17,626
  • 12
  • 64
  • 115
Gohyu
  • 468
  • 2
  • 10
  • 32
  • 1
    so, whats a problem? – SᴇM May 12 '16 at 10:34
  • 5
    Well, what happens at the moment? In particular, have you looked at `filename` in the debugger to see if it has the right value? My suspicion is that this is more likely to be a matter of encoding headers than `string.Format` being broken.... – Jon Skeet May 12 '16 at 10:34
  • Strings in C# are always Unicode. The question as such is a bit nonsensical. Are you instead asking how to provide a Unicode file name for the `Content-Disposition` header? This has nothing to do with C# at all in that case. – Joey May 12 '16 at 10:35

0 Answers0